Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1FAE-0006XK-1C for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jul 2021 21:33:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1FAC-0002zv-Eu for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jul 2021 21:33:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1FAC-0002zn-8H for pgsql-bugs@lists.postgresql.org; Wed, 07 Jul 2021 21:33:00 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1FAA-0007Ul-GU for pgsql-bugs@lists.postgresql.org; Wed, 07 Jul 2021 21:32:59 +0000 Received: from [192.168.127.1] (port=15691 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1m1FA8-0009ly-C5; Wed, 07 Jul 2021 21:32:56 +0000 Received: from localhost ([127.0.0.1]:34184 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.93.0.4 (FreeBSD)) (envelope-from ) id 1m1FA8-000ArL-7d; Wed, 07 Jul 2021 21:32:56 +0000 From: Andrew Gierth To: Tom Lane Cc: Michael Paquier , cyg0810@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17088: FailedAssertion in prepagg.c In-Reply-To: <1909846.1625692937@sss.pgh.pa.us> (Tom Lane's message of "Wed, 07 Jul 2021 17:22:17 -0400") Message-ID: <875yxlrf5x.fsf@news-spur.riddles.org.uk> References: <17088-e33882b387de7f5c@postgresql.org> <1908212.1625690962@sss.pgh.pa.us> <87a6mxrggq.fsf@news-spur.riddles.org.uk> <1909846.1625692937@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix) Date: Wed, 07 Jul 2021 22:32:56 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >>>>> "Tom" == Tom Lane writes: > Andrew Gierth writes: >> A number of places in the planner have to explicitly avoid recursing >> into GroupingFunc->args when walking trees specifically because they >> are not evaluated. It looks to me like some places where that should >> have been checked for were missed. Looking into it. Tom> Hmm. Maybe it'd be better if the default behavior in Tom> expression_tree_walker/mutator did not include recursing into the Tom> args, then? You'd think, but as I recall (I will re-check this to confirm) there were more places where we _did_ need to recurse (especially during parse analysis before we've matched up the sortgrouprefs), while most of the places where recursion needed to be explicitly avoided already needed special-case handling, so having the default the other way would likely have required a special-case almost everywhere. -- Andrew.