Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cG8dX-00065I-5O for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Dec 2016 18:14:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cG8dW-0004ZZ-69 for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Dec 2016 18:14:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cG8c7-0002yM-C0 for pgsql-hackers@postgresql.org; Sun, 11 Dec 2016 18:12:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cG8bz-0005fM-UA for pgsql-hackers@postgresql.org; Sun, 11 Dec 2016 18:12:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uBBICONA011906; Sun, 11 Dec 2016 13:12:25 -0500 From: Tom Lane To: Artur Zakirov cc: Andreas Seltenreich , pgsql-hackers Subject: Re: [sqlsmith] Crash in tsquery_rewrite/QTNBinary In-reply-to: References: <8737i01dew.fsf@credativ.de> Comments: In-reply-to Artur Zakirov message dated "Sun, 11 Dec 2016 00:07:25 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11904.1481479944.1@sss.pgh.pa.us> Date: Sun, 11 Dec 2016 13:12:24 -0500 Message-ID: <11905.1481479944@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Artur Zakirov writes: > 2016-12-07 9:06 GMT+03:00 Andreas Seltenreich : >> 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers