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 1pdxfj-0004bf-8r for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Mar 2023 18:22:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pdxfi-0007Gf-0E for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Mar 2023 18:22:22 +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 1pdxfh-0007GW-ND for pgsql-hackers@lists.postgresql.org; Sun, 19 Mar 2023 18:22:21 +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 1pdxff-0004p4-0x for pgsql-hackers@lists.postgresql.org; Sun, 19 Mar 2023 18:22:21 +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 32JIMA4k729667; Sun, 19 Mar 2023 14:22:11 -0400 From: Tom Lane To: Alexander Lakhin cc: Peter Eisentraut , Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: Extending outfuncs support to utility statements In-reply-to: <4995256b-cc65-170e-0b22-60ad2cd535f1@gmail.com> References: <4159834.1657405226@sss.pgh.pa.us> <9b197806-17ee-acba-0e70-01263aa46e79@enterprisedb.com> <1972439.1657665506@sss.pgh.pa.us> <2e7adbce-2ff5-866e-8753-9969b0ce332b@enterprisedb.com> <20220922153257.r5wj74prdqrucnov@awork3.anarazel.de> <1415326.1663863390@sss.pgh.pa.us> <1418391.1663865327@sss.pgh.pa.us> <20220922170103.6tnwbpzeddceiyyl@awork3.anarazel.de> <1944074.1663880234@sss.pgh.pa.us> <1946183.1663881687@sss.pgh.pa.us> <4995256b-cc65-170e-0b22-60ad2cd535f1@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Sun, 19 Mar 2023 15:00:01 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <729665.1679250130.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Mar 2023 14:22:10 -0400 Message-ID: <729666.1679250130@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > Please look at the function _readA_Const() (introduced in a6bc33019), wh= ich fails on current master under valgrind: > ... > Here _readA_Const() performs: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 union ValUnion *tmp =3D nodeRead(NULL, 0); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 memcpy(&local_node->val, tmp, sizeof(*tmp)); > where sizeof(union ValUnion) =3D 16, but nodeRead()->makeInteger() produ= ced Integer (sizeof(Integer) =3D 8). Right, so we can't get away without a switch-on-value-type like the other functions for A_Const have. Will fix. regards, tom lane