Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ht0yZ-0008PZ-MR for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Aug 2019 02:37:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ht0yY-0007Q1-Fg for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Aug 2019 02:37:54 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1ht0yY-0007Pt-8B for pgsql-bugs@lists.postgresql.org; Thu, 01 Aug 2019 02:37:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ht0yT-0002Cc-4d for pgsql-bugs@lists.postgresql.org; Thu, 01 Aug 2019 02:37:53 +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 x712beqD005286; Wed, 31 Jul 2019 22:37:41 -0400 From: Tom Lane To: Andres Freund cc: yi huang , pgsql-bugs@lists.postgresql.org Subject: Re: PostgreSQL12 crash bug report In-reply-to: <20190801004000.3xis75ulpun4ha3p@alap3.anarazel.de> References: <20811.1564344681@sss.pgh.pa.us> <28807.1564614449@sss.pgh.pa.us> <20190801004000.3xis75ulpun4ha3p@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 31 Jul 2019 17:40:00 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5284.1564627060.1@sss.pgh.pa.us> Date: Wed, 31 Jul 2019 22:37:40 -0400 Message-ID: <5285.1564627060@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-07-31 19:07:29 -0400, Tom Lane wrote: >> It's setting up an es_epqTupleSlot[] entry on the assumption that it >> should have the same tupdesc as the output tuple that's to be rechecked. >> This might accidentally fail to malfunction in single-table cases, >> but it's quite broken for any join case --- in particular, for the >> given test case, the scan tuple for the VALUES node surely doesn't have >> the same tupdesc as the join result. > To make sure I understand - the problem isn't the slot that we've > created in nodeModifyTable.c via EvalPlanQualSlot(), right? It's the one > we create in EvalPlanQualFetchRowMarks(), because we don't have a proper > tuple type handy to create the slot with? Yeah, I think nodeModifyTable.c is fine, because it always passes the target relation. EvalPlanQualFetchRowMarks is not fine, and I'm unsure about the call in nodeLockRows.c. > Previously we simply didn't need to know the type during EPQ setup, > because we only stored a HeapTuple anyway. And we'd know the appropriate > tupledesc at the places that access the tuple. Right. So we gotta refactor that somehow. > One bigger change - but possibly one worth it - would be to basically > move the work done in EvalPlanQualFetchRowMarks() to be done on-demand, > at least for ROW_MARK_COPY. Hm. Too tired to think that through right now. regards, tom lane