Re: bug of pg_trgm?

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: bug of pg_trgm?
Дата
Msg-id
15843.1344449141@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
bug of pg_trgm? Fujii Masao <masao.fujii@gmail.com>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
Re: bug of pg_trgm? Fujii Masao <masao.fujii@gmail.com>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
Re: bug of pg_trgm? Fujii Masao <masao.fujii@gmail.com>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
Re: bug of pg_trgm? Andrew Dunstan <andrew@dunslane.net>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
Re: bug of pg_trgm? Andrew Dunstan <andrew@dunslane.net>
Re: bug of pg_trgm? Fujii Masao <masao.fujii@gmail.com>
Re: bug of pg_trgm? Tom Lane <tgl@sss.pgh.pa.us>
... btw, I think there is another problem here, which is that
generate_wildcard_trgm will restart get_wildcard_part at the
same place that the second loop exits, which means it would
do the wrong thing if what it returns is a pointer to the
second char of an escape pair.  Consider for instance
foo\\%bar

The first call of get_wildcard_part will correctly extract "foo",
but then return a pointer to the second backslash.  So the second
call will think that the % is escaped, which it is not, leading to
a wrong decision about whether to pad "bar".

Probably a minimal fix for this could be made by backing up "endword"
one byte before returning it if in_escape is true when the second
loop exits.  That would not scale up to preserving the state of
in_wildcard_meta, but since the second loop never advances past a
meta char, that's okay for the moment.
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Fujii Masao
Дата:
От: Andrew Dunstan
Дата:
FAQ