public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Fabien COELHO <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Julien Rouhaud <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: psql - add SHOW_ALL_RESULTS option
Date: Sun, 11 Apr 2021 11:14:07 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2104091947240.3439700@pseudo>
References: <[email protected]>
	<alpine.DEB.2.22.394.2104062323150.2555247@pseudo>
	<OSZPR01MB631017521EE6887ADC9492E8FD759@OSZPR01MB6310.jpnprd01.prod.outlook.com>
	<alpine.DEB.2.22.394.2104071516470.2724014@pseudo>
	<OSZPR01MB6310325023E8B4109BB2AB90FD749@OSZPR01MB6310.jpnprd01.prod.outlook.com>
	<20210408163050.fca7dwb37zszbsmm@nol>
	<alpine.DEB.2.22.394.2104081858500.3192110@pseudo>
	<20210408171135.ekhdf5nvqss554q3@nol>
	<YG+okFpc3JaKN/[email protected]>
	<alpine.DEB.2.22.394.2104090828330.3253600@pseudo>
	<[email protected]>
	<alpine.DEB.2.22.394.2104091947240.3439700@pseudo>

Coverity has pointed out another problem with this patch:

/srv/coverity/git/pgsql-git/postgresql/src/bin/psql/common.c: 1425 in SendQuery()
1419     				/*
1420     				 * Do nothing if they are messing with savepoints themselves:
1421     				 * If the user did COMMIT AND CHAIN, RELEASE or ROLLBACK, our
1422     				 * savepoint is gone. If they issued a SAVEPOINT, releasing
1423     				 * ours would remove theirs.
1424     				 */
>>>     CID 1476042:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "strcmp(PQcmdStatus(results), "COMMIT") == 0" inside this statement: "if (results && (strcmp(PQcm...".
1425     				if (results &&
1426     					(strcmp(PQcmdStatus(results), "COMMIT") == 0 ||
1427     					 strcmp(PQcmdStatus(results), "SAVEPOINT") == 0 ||
1428     					 strcmp(PQcmdStatus(results), "RELEASE") == 0 ||
1429     					 strcmp(PQcmdStatus(results), "ROLLBACK") == 0))
1430     					svptcmd = NULL;

It's right: this is dead code because all paths through the if-nest
starting at line 1373 now leave results = NULL.  Hence, this patch
has broken the autocommit logic; it's no longer possible to tell
whether we should do anything with our savepoint.

Between this and the known breakage of control-C, it seems clear
to me that this patch was nowhere near ready for prime time.
I think shoving it in on the last day before feature freeze was
ill-advised, and it ought to be reverted.  We can try again later.

			regards, tom lane





view thread (104+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: psql - add SHOW_ALL_RESULTS option
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox