oid failures on Alpha solved

Поиск
Список
Период
Сортировка
От Brent Verner
Тема oid failures on Alpha solved
Дата
Msg-id 20001230090009.A29966@rcfile.org
обсуждение исходный текст
Ответы Re: oid failures on Alpha solved  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,
 It turns out the problem causing the oid failures is with our 
snprintf. specifically we are formatting "%u" incorrectly:

using a enhanced-for-testing version of our snprintf I get.

formatting '-1040' with '%lu' snprintf = 18446744073709550576 sprintf  = 18446744073709550576

formatting '-1040' with '%u' snprintf = 18446744073709550576 sprintf  = 4294966256


oidout() is where the offending call originates, FWIW. snprintf(result, 12, "%u", o);

I've massaged in the snprintf.c code from openssh into postgres, and 
oid now passes the regression test, but have a couple of questions: 1) could the openssh code be a candidate to replace
ourversion? It     looks quite a bit more 'featureful', and I'd imagine it is about     as safe as snprintf gets. 2) do
we_need_ oidout() to "%u", or could we "%lu" and fully take    advantage of the longer long on 64bit platforms?
 

cheers. brent


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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Creating locales.
Следующее
От: mlw
Дата:
Сообщение: Re: GNU readline and BSD license