Re: OID from insert has extra letter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: OID from insert has extra letter
Дата
Msg-id 26680.981507066@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: OID from insert has extra letter  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Список pgsql-hackers
"Ross J. Reedstrom" <reedstrm@rice.edu> writes:
> Seems it's a non-portable behavior:

Not at all.  The code is asking strncpy to copy n bytes, where n is
known to be <= strlen of the source string.  Every spec-conforming
implementation of strncpy will copy n bytes, no more, no less, and
will *not* add a trailing null after them.  The only reason the code
appeared to work is that it was dealing with a static buffer that
starts out all zeroes, so the trailing null was already in place.
Until the buffer had been used for a longer OID, that is.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Include files for SPI are not installed
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Duplicate OIDs in pg_attribute