Re: Checking assumptions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Checking assumptions
Дата
Msg-id 19884.1145552542@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Checking assumptions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Martijn van Oosterhout <kleptog@svana.org> writes:
>> src/backend/utils/adt/selfuncs.c function like_selectivity

>> Assume this function is never called with a zero length bytea
>> constant. It just looks wierd to set patt to NULL only to Assert() it
>> three lines down.

> This may be a real bug --- I'm not sure how well the bytea-LIKE path has
> been tested, and it looks odd to me too.

I checked into this, and in fact the path can't be taken: we only reach
like_selectivity when trying to estimate selectivity of a pattern that
is not an "exact match" pattern --- and in LIKE, that requires at least
one wildcard, so the pattern can't be empty.

So there's no bug, but the coding is certainly a bit obscure --- I'll
try to make it more clear.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: float8 regression test failure in head
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Unresolved Win32 bug reports