Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLoB5-000ZNr-Bf for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Jan 2024 17:40:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rLoB4-002JzL-At for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Jan 2024 17:40:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLoB4-002Jz6-0S for pgsql-bugs@lists.postgresql.org; Fri, 05 Jan 2024 17:40:14 +0000 Received: from gmmr-4.centrum.cz ([2a00:da80:1:502::8]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLoB0-0001i9-E6 for pgsql-bugs@lists.postgresql.org; Fri, 05 Jan 2024 17:40:13 +0000 Received: from gmmr-4.centrum.cz (localhost [127.0.0.1]) by gmmr-4.centrum.cz (Postfix) with ESMTP id 79B588523C for ; Fri, 5 Jan 2024 18:40:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=centrum.cz; s=mail; t=1704476408; bh=CmRgT67pWd63lKJShhNTS0wCLiuIni2HBTOaBg0N+eE=; h=Date:From:Subject:To:Cc:From; b=FDMkuzl2IQu0abhHFzjC/dbSXNrMMOwGDgcdm7wUaOkrxsiQPKIU2qnyRQrFJowDy EBLGfFsWqE0jTmteBB178lDHZWu0pyRer0KteuJFy4P6D+mxCYnuRSKfZFYxpEU4cW CWoGA/52qNJew2LdB18QPO0L69uZyl/R5/HolCjA= Received: from antispam55.centrum.cz (unknown [10.30.208.55]) by gmmr-4.centrum.cz (Postfix) with ESMTP id 68AE02016E1A for ; Fri, 5 Jan 2024 18:40:08 +0100 (CET) X-IPAS-Result: =?us-ascii?q?A2H2AgDGPphl/83h/y5aHAECAgEHARQBBAQBghCBNluDA?= =?us-ascii?q?3WDXpFjA4tdE4tBhmSBXA4JBgEBAQEBAQEBAQkuARUEAQE/hEeHOyg4EwECB?= =?us-ascii?q?AEBAQEDAgMBAQEBAQEIAQEGAQEBAQEBBgYBAoEZhS9KglWDdQEBAQECAiJWB?= =?us-ascii?q?RAGBBQjBwIiBzUBEhGFGgEDDiOwInqBMoEBsWoFRg1MYIEogUiHfR4BgU4Bi?= =?us-ascii?q?FOCT4QOMT6CH4ILZoMOOYIvBIIYg0KJe4VBUoEeA10oBFwPGw8eNxEQEw0DC?= =?us-ascii?q?G4dAjE8AwUDBDIKEgwLIQUSQwIBQAZJCwMCGgUDAwSBMAUNGgIQGgYMJgMDE?= =?us-ascii?q?kkCEBQDOwMDBgMKMQMwVUIMUANlHzIJPA8MGgIbHg0nIwIsQgMRBRACFgMkF?= =?us-ascii?q?gQ0EQkLKAMsBjgCEgwGBgldJhYJBCUDCAQDVAMjdBEDBAoDFAcLB2MDRB02C?= =?us-ascii?q?gMLbT01FBsGlz6BKzCBJScfC2GjV4w8lAVwB4QUhEiUXYF7hXMESaoOiAYOi?= =?us-ascii?q?hCGKSCRRZcBgXqBf4QnUhkPjlh0AQmSPHU7AgcBCgEBAwmCO4ZngUYBAQ?= IronPort-PHdr: A9a23:n8woUx/anfRPqP9uWTu7ngc9DxPPW53KNwIYoqAql6hJOvz6uci4b AqFuaQm3Q+BdL6YwswHotKViZyoYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7G MNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+5Z7ebx9WiDeyZb5+I xG7oAbMvcQKnIVuLbo8xRTOrnZUYepawn9mK0yOlBjm/Mew+5B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Wf rOoB17726RtN9/YhwdcLy7VJVoIkmsl6Kdn7NhWItKNTOO0ADDEGgI1+TfKlPbdREXIIVmpM RdmtNFaOHNMQ== X-Talos-CUID: 9a23:dwUDDGOStKQHWu5DCBdlt3dMPssZSj7B00/0e1WmUlk2R+jA X-Talos-MUID: 9a23:GsoWPAvJzYVOQVDJT82nijwzN8xj4qCXAWdcyZ4X4Nu6G3FcAmLI X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.04,334,1695679200"; d="scan'208";a="6853088" Received: from gmmr-3.centrum.cz ([46.255.225.205]) by antispam55.centrum.cz with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 18:39:32 +0100 Received: from mail1012.cent (envoy-stl.cent [10.32.56.18]) by gmmr-3.centrum.cz (Postfix) with ESMTP id 5A05D1021781; Fri, 5 Jan 2024 18:39:32 +0100 (CET) Received: from 2a00:11b7:3004:cf00:f12c:4b30:bb31:7209 by mail1012.centrum.cz (centrum.cz multimail) with HTTP; Fri, 05 Jan 2024 18:39:32 +0100 Date: Fri, 05 Jan 2024 18:39:32 +0100 From: =?utf-8?q?Vojt=c4=9bch_Bene=c5=a1?= Subject: Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type To: , Cc: X-Priority: 3 X-Original-From: =?utf-8?q?Vojt=C4=9Bch_Bene=C5=A1?= MIME-Version: 1.0 Message-Id: <20240105183932.2D7B2BB4@centrum.cz> Content-Type: multipart/mixed; boundary="_ca29_-------44287d575fc8af21aeeb8d3b1b838f1a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --_ca29_-------44287d575fc8af21aeeb8d3b1b838f1a Content-Type: multipart/alternative; boundary="_d32c_-------7315ba88121be86cded025951ddb9efa" --_d32c_-------7315ba88121be86cded025951ddb9efa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable I am impressed with how quickly you addressed the issue. I tested queries m= yself on latest builds and issue is resolved. Also all errors we were getti= ng in more complex queries are gone. =20 Thank you for your work. Vojt=C4=9Bch =C2=A0 ______________________________________________________________ > Od: "David Rowley" > Komu: "Tom Lane" > Datum: 04.01.2024 08:43 > P=C5=99edm=C4=9Bt: Re: BUG #18264: Table has type text, but query expect= s integer.attribute 1 of type record has wrong type > > CC: On Sun, 31 Dec 2023 at 16:24, David Rowley wrote: > It looks like the problem is in ExecEvalPreOrderedDistinctMulti(). It > overwrites the tmpcontext's slots but fails to properly restore the > originals again. =20 I pushed a slightly revised version of this. =C2=A0I ended up adding a boo= l isdistinct local variable so I didn't have to reset the slots in two places. =C2=A0It kinda makes it easier to see what the true and false means, so that might have been a good change regardless of the bug. =20 Thanks for reporting this Vojt=C4=9Bch and for the reproducer script. =20 David --_d32c_-------7315ba88121be86cded025951ddb9efa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I am impressed with how quickly you addressed the issue. I teste= d queries myself on latest builds and issue is resolved. Also all errors we= were getting in more complex queries are gone.


Thank you for your work.

Vojt=C4=9Bch

 

___________________________= ___________________________________
> Od: "David Rowley" <dgrowleyml@gmail.com>
> Komu: "Tom Lane" <tgl@sss.pgh.pa.us>
> Datum: 04.01.2024 08:43
> P=C5=99edm=C4=9Bt: Re: BUG #18264: Table has type text, but query exp= ects integer.attribute 1 of type record has wrong type
>

> CC: <pgsql-bugs@lis= ts.postgresql.org>

On Sun, 31 Dec 2023 at 16:24, David Rowley <dgrowleyml@gmail.com> wro= te:
> It looks like the problem is in ExecEvalPreOrderedDistinctMulti(). It=
> overwrites the tmpcontext's slots but fails to properly restore the > originals again.

I pushed a slightly revised version of this.  I ended up adding a boo= l
isdistinct local variable so I didn't have to reset the slots in two
places.  It kinda makes it easier to see what the true and false
means, so that might have been a good change regardless of the bug.

Thanks for reporting this Vojt=C4=9Bch and for the reproducer script.

David
--_d32c_-------7315ba88121be86cded025951ddb9efa-- --_ca29_-------44287d575fc8af21aeeb8d3b1b838f1a--