From: Michael Paquier <michael@paquier.xyz>
To: Japin Li <japinli@hotmail.com>
Cc: amutu@amutu.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18134: ROW_COUNT do not set to 0 when psql's \gset command get no rows returned
Date: Sun, 1 Oct 2023 08:48:10 +0900
Message-ID: <ZRizujD8HMMpSXG5@paquier.xyz> (raw)
In-Reply-To: <MEYP282MB1669351F137C61C19FA9749BB6C2A@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
References: <18134-87126d90cb4dd049@postgresql.org>
<MEYP282MB1669351F137C61C19FA9749BB6C2A@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
On Wed, Sep 27, 2023 at 06:00:58PM +0800, Japin Li wrote:
> It seems SaveResultVariables() was lost when executing failed. Attached fix it.
Yeah, I think that you're right here, the variables should be set.
SetResultVariables() ought to be called even if \gset failed to return
a result. We have a bunch of paths in the psql code (for backend
errors as well as errors internal to psql) where things are done this
way, and the top of SetResultVariables() even documents that.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, japinli@hotmail.com, amutu@amutu.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18134: ROW_COUNT do not set to 0 when psql's \gset command get no rows returned
In-Reply-To: <ZRizujD8HMMpSXG5@paquier.xyz>
* 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