Re: like/ilike improvements

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: like/ilike improvements
Дата
Msg-id 13135.1180027067@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: like/ilike improvements  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: like/ilike improvements  (Andrew Dunstan <andrew@dunslane.net>)
Re: like/ilike improvements  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> OK, Here is a patch that I am fairly confident does what's been 
> discussed, as summarised by Tom.

> ! #define CHAREQ(p1, p2) (*p1 == *p2)
> ...
> + #define IsFirstByte(c) ((*c & 0xC0) != 0x80)

These macros are bugs waiting to happen.  Please parenthesize the
arguments.

The header comment for like_match.c needs more love:
* This file is included by like.c *twice*, to provide an optimization* for single-byte encodings.

I'm not sure I believe the new coding for %-matching at all, and I
certainly don't like the 100% lack of comments explaining why the
different cases are necessary and just how they differ.  In particular,
once we've advanced more than one character, why does it still matter
what was immediately after the %?

There should somewhere be a block comment explaining all the reasoning
we've so painfully gone through about why the three cases (SB, MB, UTF8)
are needed and how they must differ.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Help Required regarding implementing operators in postgreSQL
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: like/ilike improvements