Re: minor smgr code cleanup

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: minor smgr code cleanup
Дата
Msg-id 87fzetoshv.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответ на Re: minor smgr code cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane <tgl@sss.pgh.pa.us> writes:
> This change is actually wrong (backwards), no?  You want a true result
> on equality.

*sigh*, I'm an idiot. Thanks for catching my mistake!

> Pretending that the result of strcmp is a bool is a type pun, and
> one that can rise up to bite you.  In the case at hand, strncmp is
> allowed to return (say) 256 to indicate a nonzero result --- which
> would be lost when the value is squeezed into a bool (char).  See
> the archives; we've had at least one bug of this ilk.

Good point, and good to know. I just left the code as it previously
was (but updated the comment), and applied the patch.

Thanks again.

-Neil


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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: remove 'noversion' from standalone backend
Следующее
От: Tom Lane
Дата:
Сообщение: Re: remove 'noversion' from standalone backend