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 1lvK3T-0007NP-HL for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jun 2021 13:33:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lvK3S-0001ZF-En for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jun 2021 13:33:34 +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 1lvK3S-0001Z7-8M for pgsql-bugs@lists.postgresql.org; Mon, 21 Jun 2021 13:33:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvK3Q-00023j-1Z for pgsql-bugs@lists.postgresql.org; Mon, 21 Jun 2021 13:33:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15LDXT591641485; Mon, 21 Jun 2021 09:33:29 -0400 From: Tom Lane To: David Rowley cc: cyg0810@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #17067: FailedAssertion at castNodeImpl In-reply-to: References: <17067-665d50fa321f79e0@postgresql.org> Comments: In-reply-to David Rowley message dated "Mon, 21 Jun 2021 21:47:49 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1641483.1624282409.1@sss.pgh.pa.us> Date: Mon, 21 Jun 2021 09:33:29 -0400 Message-ID: <1641484.1624282409@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Mon, 21 Jun 2021 at 20:15, PG Bug reporting form > wrote: >> run the following sql command through client and the PostgreSQL database >> process will crash: > Thanks for the report. It looks like a thinko in 1d581ce71. Code > was added there which insists the initial list element is a List, but > it's an IntList. I think the code should just use linitial instead of > linitial_node. Hmm, if it's an int-list then the subsequent dup-elimination loop is also wrong, and for that matter I don't think the preceding lines would have worked. > I'm quite surprised that we don't have a test that picks this up. The code coverage report shows that we *do* have tests that run through this code, so the existing typing is okay in the test cases we have. I'm guessing the real problem is that something upstream is generating the wrong type of list in this example. regards, tom lane