From: Tom Lane <tgl@sss.pgh.pa.us>
To: Euler Taveira <euler@eulerto.com>
Cc: webbohan@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19073: there are meaningless code in _SPI_execute_plan() when canSetTag is true
Date: Sun, 05 Oct 2025 11:48:33 -0400
Message-ID: <1680816.1759679313@sss.pgh.pa.us> (raw)
In-Reply-To: <5b04da16-c2de-464b-8677-9e4991b28e55@app.fastmail.com>
References: <19073-93772b97a2f1ecf3@postgresql.org>
<5b04da16-c2de-464b-8677-9e4991b28e55@app.fastmail.com>
"Euler Taveira" <euler@eulerto.com> writes:
> On Sat, Oct 4, 2025, at 11:29 PM, PG Bug reporting form wrote:
>> If plan is canSetTag subqueries, `SPI_freetuptable(my_tuptable)` is
>> meaningless, because `my_tuptable` is NULL.
> There could be multiple statements. The first case will call SPI_freetuptable()
> and it is a noop. The code path you are referring to is inside a foreach loop
> and a previous statement might set my_tuptable and needs to be freed before
> reusing it. That's exactly what the comment says.
Yeah. You'd only reach this case if there were multiple SQL
statements in the string given to SPI_execute() or similar,
but that's perfectly legal.
regards, tom lane
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: tgl@sss.pgh.pa.us, euler@eulerto.com, webbohan@qq.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19073: there are meaningless code in _SPI_execute_plan() when canSetTag is true
In-Reply-To: <1680816.1759679313@sss.pgh.pa.us>
* 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