[COMMITTERS] pgsql: Prevent crash when ts_rewrite() replaces a non-top-levelsubtree

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Prevent crash when ts_rewrite() replaces a non-top-levelsubtree
Дата
Msg-id E1cG8Zi-0007C4-6u@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Prevent crash when ts_rewrite() replaces a non-top-level subtree with null.

When ts_rewrite()'s replacement argument is an empty tsquery, it's supposed
to simplify any operator nodes whose operand(s) become NULL; but it failed
to do that reliably, because dropvoidsubtree() only examined the top level
of the result tree.  Rather than make a second recursive pass, let's just
give the responsibility to dofindsubquery() to simplify while it's doing
the main replacement pass.  Per report from Andreas Seltenreich.

Artur Zakirov, with some cosmetic changes by me.  Back-patch to all
supported branches.

Discussion: https://postgr.es/m/8737i01dew.fsf@credativ.de

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6f5cb982e7df8f277505fd2028be83211d586769

Modified Files
--------------
src/backend/utils/adt/tsquery_rewrite.c | 58 ++++++++++++++++-----------------
src/test/regress/expected/tsearch.out   | 15 +++++++++
src/test/regress/sql/tsearch.sql        |  3 ++
3 files changed, 47 insertions(+), 29 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Be more careful about Python refcounts while creatingexception
Следующее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Use "%option prefix" to set API names in ecpg's lexer.