From: webbohan <webbohan@qq.com>
To: webbohan <webbohan@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: 回复:BUG #19073: there are meaningless code in _SPI_execute_plan() when canSetTag is true
Date: Sun, 5 Oct 2025 18:05:59 +0800
Message-ID: <tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com> (raw)
In-Reply-To: <19073-93772b97a2f1ecf3@postgresql.org>
References: <19073-93772b97a2f1ecf3@postgresql.org>
there is patch.
I have remove the meaningless code.
------------------ 原始邮件 ------------------
发件人: "webbohan" <noreply@postgresql.org>;
发送时间: 2025年10月5日(星期天) 上午10:29
收件人: "pgsql-bugs"<pgsql-bugs@lists.postgresql.org>;
抄送: "webbohan"<webbohan@qq.com>;
主题: BUG #19073: there are meaningless code in _SPI_execute_plan() when canSetTag is true
The following bug has been logged on the website:
Bug reference: 19073
Logged by: Webbo Han
Email address: webbohan@qq.com
PostgreSQL version: 18.0
Operating system: all
Description:
In function _SPI_execute_plan(), `my_tuptable` is local variable and
initialized as NULL.
If plan is canSetTag subqueries, `SPI_freetuptable(my_tuptable)` is
meaningless, because `my_tuptable` is NULL.
We'd better remove this code.
Attachments:
[application/octet-stream] remove_meaningless_code.patch (438B, ../tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com/3-remove_meaningless_code.patch)
download | inline diff:diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.cindex ecb2e4ccaa1..23143cc48d3 100644--- a/src/backend/executor/spi.c+++ b/src/backend/executor/spi.c@@ -2773,7 +2773,6 @@ _SPI_execute_plan(SPIPlanPtr plan, const SPIExecuteOptions *options,
if (canSetTag)
{
my_processed = _SPI_current->processed;
- SPI_freetuptable(my_tuptable);
my_tuptable = _SPI_current->tuptable;
my_res = res;
}
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: webbohan@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: =?gb18030?B?u9i4tKO6QlVHICMxOTA3MzogdGhlcmUgYXJlIG1l?= =?gb18030?B?YW5pbmdsZXNzIGNvZGUgaW4gX1NQSV9leGVjdXRl?= =?gb18030?B?X3BsYW4oKSB3aGVuIGNhblNldFRhZyBpcyB0cnVl?=
In-Reply-To: <tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox