From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Prevent crash when ts_rewrite() replaces a non-top-level subtree |
Date: | 2016-12-11 18:10:14 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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/[email protected]
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/79e1a9efa808d2e15ea41d06d7696a6daab05467
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-12-11 19:54:40 | pgsql: Use "%option prefix" to set API names in ecpg's lexer. |
Previous Message | Jim Nasby | 2016-12-10 23:19:32 | Re: [COMMITTERS] pgsql: Implement table partitioning. |