[COMMITTERS] pgsql: Fix regexport.c to behave sanely with lookaround constraints.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Fix regexport.c to behave sanely with lookaround constraints.
Дата
Msg-id E1cym8k-0007Dh-Rh@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix regexport.c to behave sanely with lookaround constraints.

regexport.c thought it could just ignore LACON arcs, but the correct
behavior is to treat them as satisfiable while consuming zero input
(rather reminiscently of commit 9f1e642d5).  Otherwise, the emitted
simplified-NFA representation may contain no paths leading from initial
to final state, which unsurprisingly confuses pg_trgm, as seen in
bug #14623 from Jeff Janes.

Since regexport's output representation has no concept of an arc that
consumes zero input, recurse internally to find the next normal arc(s)
after any LACON transitions.  We'd be forced into changing that
representation if a LACON could be the last arc reaching the final
state, but fortunately the regex library never builds NFAs with such
a configuration, so there always is a next normal arc.

Back-patch to 9.3 where this logic was introduced.

Discussion: https://postgr.es/m/20170413180503.25948.94871@wrigleys.postgresql.org

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5be58cc89acef45fff14159fdfefbacfac08bfde

Modified Files
--------------
contrib/pg_trgm/expected/pg_trgm.out | 12 +++++
contrib/pg_trgm/sql/pg_trgm.sql      |  3 ++
src/backend/regex/regexport.c        | 92 ++++++++++++++++++++++++++----------
3 files changed, 82 insertions(+), 25 deletions(-)


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [COMMITTERS] pgsql: doc: add missing sect1 close tag
Следующее
От: Peter Eisentraut
Дата:
Сообщение: [COMMITTERS] pgsql: pg_dumpall: Allow --no-role-passwords and --binary-upgradetoget