回复:BUG #19073: there are meaningless code in _SPI_execute_plan() when canSetTag is true

webbohan <webbohan@qq.com>

From: webbohan <webbohan@qq.com>
To: webbohan <webbohan@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2025-10-05T10:05:59Z
Lists: pgsql-bugs

Attachments

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.