pgsql: Fix similar_escape() so that SIMILAR TO works properly for

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix similar_escape() so that SIMILAR TO works properly for
Дата
Msg-id 20060413180153.DC3D411F6613@postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix similar_escape() so that SIMILAR TO works properly for patterns involving
alternatives ("|" symbol).  The original coding allowed the added ^ and $
constraints to be absorbed into the first and last alternatives, producing
a pattern that would match more than it should.  Per report from Eric Noriega.

I also changed the pattern to add an ARE director ("***:"), ensuring that
SIMILAR TO patterns do not change behavior if regex_flavor is changed.  This
is necessary to make the non-capturing parentheses work, and seems like a
good idea on general principles.

Back-patched as far as 7.4.  7.3 also has the bug, but a fix seems impractical
because that version's regex engine doesn't have non-capturing parens.

Tags:
----
REL7_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        regexp.c (r1.49.4.2 -> r1.49.4.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/regexp.c.diff?r1=1.49.4.2&r2=1.49.4.3)

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix similar_escape() so that SIMILAR TO works properly for
Следующее
От: nwakefield@pgfoundry.org (User Nwakefield)
Дата:
Сообщение: bizgres - bizgres: Added automatic support for optional quotes.