Re: [sqlsmith] Crash in tsquery_rewrite/QTNBinary
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Artur Zakirov <a.zakirov@postgrespro.ru>
Cc: Andreas Seltenreich <seltenreich@gmx.de>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-12-11T18:12:24Z
Lists: pgsql-hackers
Artur Zakirov <a.zakirov@postgrespro.ru> writes: > 2016-12-07 9:06 GMT+03:00 Andreas Seltenreich <seltenreich@gmx.de>: >> the following query crashes master as of 4212cb7. > It happens because 'I' is stop word and substitute query becomes > empty. And for queries above we need recursive dropvoidsubtree() > function. Without this patch this function cleans only first level of > tree. And query above becomes: '6 | void'. > Firstly I made recursive dropvoidsubtree(). But attached patch cleans > query tree in dofindsubquery() to avoid extra tree scan. This patch looks good to me. I have to admit that I'd been suspicious of dropvoidsubtree() the last time I looked at this code, but I didn't have adequate reason to touch it. Pushed with some minor comment adjustments. regards, tom lane
Commits
-
Prevent crash when ts_rewrite() replaces a non-top-level subtree with null.
- f4ccee408d7f 9.2.20 landed
- c8bfe055be9c 9.6.2 landed
- c6caa5200087 9.5.6 landed
- 79e1a9efa808 9.3.16 landed
- 6f5cb982e7df 9.4.11 landed
- 0eaaaf00e296 10.0 landed