Re: PQntuples return type

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: PQntuples return type
Дата
Msg-id db0eb91047d052e22ad6b960a06d5d8a@biglumber.com
обсуждение исходный текст
Ответ на PQntuples return type  ("Luca Ciciriello" <luca_ciciriello@hotmail.com>)
Ответы Re: PQntuples return type  (Bruce Momjian <bruce@momjian.us>)
Re: PQntuples return type  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> So, my doubt is: if the return type is int instead of unsigned int,
> is this function testable for negative return values?

A quick glance at the code in fe-exec.c and fe-protocol3.c shows that
the underlying variable starts at 0 as an int and in incremented by
one every row, so it seems possible that it could wrap around for
very large results sets and/or boxes with a low representation of 'int'.
There may be some other safeguards in place I did not see to prevent this,
but I don't see a reason why we shouldn't use unsigned int or
unsigned long int here, both for ntups and the return value of the
function.

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200707300937
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGrfPXvJuQZxSWSsgRA6gZAJ9O5dkgEIstoqhcYjz87V2REUhLWQCgr+uW
1eIVpiahum4ML0Zz7ANlrl0=
=YqJu
-----END PGP SIGNATURE-----



В списке pgsql-general по дате отправления:

Предыдущее
От: Henrik Zagerholm
Дата:
Сообщение: Re: Slow query but can't see whats wrong
Следующее
От: Robert Treat
Дата:
Сообщение: Re: [pgsql-advocacy] European users mailing list