pgsql: Fix misbehavior in contrib/pg_trgm with an unsatisfiable regex.
В списке pgsql-committers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | pgsql: Fix misbehavior in contrib/pg_trgm with an unsatisfiable regex. |
| Дата | |
| Msg-id | E1pb2p0-00330s-LR@gemulon.postgresql.org обсуждение |
| Список | pgsql-committers |
Fix misbehavior in contrib/pg_trgm with an unsatisfiable regex. If the regex compiler can see that a regex is unsatisfiable (for example, '$foo') then it may emit an NFA having no arcs. pg_trgm's packGraph function did the wrong thing in this case; it would access off the end of a work array, and with bad luck could produce a corrupted output data structure causing more problems later. This could end with wrong answers or crashes in queries using a pg_trgm GIN or GiST index with such a regex. Fix by not trying to de-duplicate if there aren't at least 2 arcs. Per bug #17830 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17830-57ff5f89bdb02b09@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1925ac281a238fab50e208548f98daffdaaa0896 Modified Files -------------- contrib/pg_trgm/expected/pg_word_trgm.out | 6 ++++++ contrib/pg_trgm/sql/pg_word_trgm.sql | 3 +++ contrib/pg_trgm/trgm_regexp.c | 26 ++++++++++++++++---------- 3 files changed, 25 insertions(+), 10 deletions(-)
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера