Re: strncmp->memcmp when we know the shorter length

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strncmp->memcmp when we know the shorter length
Дата
Msg-id 11172.1292988287@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: strncmp->memcmp when we know the shorter length  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: strncmp->memcmp when we know the shorter length  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> If it's done properly, I don't see how this would be a risk.

I'm fairly uncomfortable about the broad swath and low return of this
patch.  Noah is assuming that none of these places are relying on
strncmp to stop short upon finding a null, and I don't believe that
that's a safe assumption in every single place.  Nor do I believe that
it's worth the effort of trying to prove it safe in most of those
places.

I think this might be a good idea in the varchar.c and varlena.c calls,
but I'd be inclined to leave the rest of the calls alone.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: strncmp->memcmp when we know the shorter length
Следующее
От: Robert Haas
Дата:
Сообщение: Re: strncmp->memcmp when we know the shorter length