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 1tf0hg-00Gvfb-I7 for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 17:57:49 +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 1tf0hf-00Fh2t-Kf for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 17:57:47 +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 1tf0hf-00Fh21-5Z for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 17:57:47 +0000 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tf0hb-0034mn-38 for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 17:57:46 +0000 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c10:4a4:0:640:7b31:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 4579C60E9B; Mon, 3 Feb 2025 20:57:40 +0300 (MSK) Received: from smtpclient.apple (10.211.55.14-vpn.dhcp.yndx.net [10.211.55.14]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id cvndOV2IbuQ0-gyikAAD2; Mon, 03 Feb 2025 20:57:39 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1738605459; bh=YSWOuNdVGMuhQfrDuEJgLuk/d7bT2r7z9PuA8MyyzmY=; h=References:To:Cc:In-Reply-To:Date:From:Message-Id:Subject; b=QT57wNxVTugvc+kJyw6vev6QjCP1fFbuM+J46FLf3ajR1NN91v4WjmYEEahw5UpZf 7GD7yfOYABpbFk+iYmzMPqe1QcTnvQF4BjMfggh3m89oi+eUbAqmulQeYhSHn+1GA8 01SPcY5a5VpSRQKma6HiTrnL5nrdzjeGUBC4NfvA= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Andrey Borodin Message-Id: <5AAA4DBE-4CC2-4D22-B138-BF2D48AE096F@yandex-team.ru> Content-Type: multipart/mixed; boundary="Apple-Mail=_DA90EB9D-DE31-498D-B2EF-94C659006D3C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: Using Expanded Objects other than Arrays from plpgsql Date: Mon, 3 Feb 2025 22:57:27 +0500 In-Reply-To: <412280.1738604208@sss.pgh.pa.us> Cc: Pavel Borisov , Michel Pelletier , Pavel Stehule , pgsql-hackers@lists.postgresql.org To: Tom Lane References: <1342498.1729444411@sss.pgh.pa.us> <1445998.1729482404@sss.pgh.pa.us> <2062830.1729625620@sss.pgh.pa.us> <2265411.1729699470@sss.pgh.pa.us> <2354718.1729737539@sss.pgh.pa.us> <2581216.1729794746@sss.pgh.pa.us> <1948345.1730500073@sss.pgh.pa.us> <3797606.1732045516@sss.pgh.pa.us> <1417389.1736964543@sss.pgh.pa.us> <3363452.1737483125@sss.pgh.pa.us> <0AC229FA-A3F1-43FD-B0DC-A46A73FEAFF7@yandex-team.ru> <931398.1737905825@sss.pgh.pa.us> <38A31221-C1C4-4846-9709-D66ACD76E87A@yandex-team.ru> <46876.1737918281@sss.pgh.pa.us> <3682021.1738288421@sss.pgh.pa.us> <256915.1738533419@sss.pgh.pa.us> <932C9840-63D6-469D-9C65-1B1A14594D29@yandex-team.ru> <412280.1738604208@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3776.700.51.11.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_DA90EB9D-DE31-498D-B2EF-94C659006D3C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 3 Feb 2025, at 22:36, Tom Lane wrote: >=20 > I'm not wedded to that name; do you have a better idea? I'd propose something like attached. But feel free to ignore my = suggestion: I do not understand context of these structure members. Best regards, Andrey Borodin. --Apple-Mail=_DA90EB9D-DE31-498D-B2EF-94C659006D3C Content-Disposition: attachment; filename=rename.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="rename.diff" Content-Transfer-Encoding: 7bit diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h index 191d8fe34d..594cdc2bcb 100644 --- a/src/include/executor/execExpr.h +++ b/src/include/executor/execExpr.h @@ -424,8 +424,8 @@ typedef struct ExprEvalStep struct { ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */ - void *paramarg; /* private data for same */ - void *paramarg2; /* more private data for same */ + void *exprarg; /* private data for PLpgSQL_expr* */ + void *paramarg; /* more private data for Param* */ int paramid; /* numeric ID for parameter */ Oid paramtype; /* OID of parameter's datatype */ } cparam; diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index d4377ceecb..ddc8e511cc 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -6505,8 +6505,8 @@ plpgsql_param_compile(ParamListInfo params, Param *param, * pointers to the PLpgSQL_expr as well as this specific Param, to support * plpgsql_param_eval_var_check(). */ - scratch.d.cparam.paramarg = expr; - scratch.d.cparam.paramarg2 = param; + scratch.d.cparam.exprarg = expr; + scratch.d.cparam.paramarg = param; scratch.d.cparam.paramid = param->paramid; scratch.d.cparam.paramtype = param->paramtype; ExprEvalPushStep(state, &scratch); @@ -6550,8 +6550,8 @@ plpgsql_param_eval_var_check(ExprState *state, ExprEvalStep *op, if (!var->isnull && VARATT_IS_EXTERNAL_EXPANDED_RW(DatumGetPointer(var->value))) { - PLpgSQL_expr *expr = (PLpgSQL_expr *) op->d.cparam.paramarg; - Param *param = (Param *) op->d.cparam.paramarg2; + PLpgSQL_expr *expr = (PLpgSQL_expr *) op->d.cparam.exprarg; + Param *param = (Param *) op->d.cparam.paramarg; /* * We might have already figured this out while evaluating some other --Apple-Mail=_DA90EB9D-DE31-498D-B2EF-94C659006D3C--