pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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.




------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "webbohan"                                                                                    <noreply@postgresql.org&gt;;
发送时间:&nbsp;2025年10月5日(星期天) 上午10:29
收件人:&nbsp;"pgsql-bugs"<pgsql-bugs@lists.postgresql.org&gt;;
抄送:&nbsp;"webbohan"<webbohan@qq.com&gt;;
主题:&nbsp;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:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19073
Logged by:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Webbo Han
Email address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; webbohan@qq.com
PostgreSQL version: 18.0
Operating system:&nbsp;&nbsp; all
Description:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

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.c
index 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;
 			}


Message-ID: <tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com>
Permalink:  ../tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com/
Also on:    postgresql.org/message-id/tencent_E7B3EB9BCD305CBF3C20AF141C782B8DB307@qq.com

 ·  · 

reply

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