Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVbnL-0000GK-LH for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Apr 2021 15:14:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lVbnJ-0003LR-Sq for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Apr 2021 15:14:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVbnJ-0003Kg-MO for pgsql-hackers@lists.postgresql.org; Sun, 11 Apr 2021 15:14:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lVbnD-0008UQ-Eb for pgsql-hackers@lists.postgresql.org; Sun, 11 Apr 2021 15:14:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13BFE7k22671236; Sun, 11 Apr 2021 11:14:08 -0400 From: Tom Lane To: Fabien COELHO cc: Peter Eisentraut , Michael Paquier , Julien Rouhaud , "shiy.fnst@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" Subject: Re: psql - add SHOW_ALL_RESULTS option In-reply-to: References: <1ec5ef49-b5c8-4129-e680-fe42f8d0670b@2ndquadrant.com> <20210408163050.fca7dwb37zszbsmm@nol> <20210408171135.ekhdf5nvqss554q3@nol> Comments: In-reply-to Fabien COELHO message dated "Fri, 09 Apr 2021 20:04:11 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2671234.1618154047.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 11 Apr 2021 11:14:07 -0400 Message-ID: <2671235.1618154047@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Coverity has pointed out another problem with this patch: /srv/coverity/git/pgsql-git/postgresql/src/bin/psql/common.c: 1425 in Send= Query() 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") =3D=3D 0" inside this statement: "if (results && (strcmp(PQcm.= ..". 1425 if (results && 1426 (strcmp(PQcmdStatus(results), "COMMIT") =3D=3D 0 || 1427 strcmp(PQcmdStatus(results), "SAVEPOINT") =3D=3D 0 || 1428 strcmp(PQcmdStatus(results), "RELEASE") =3D=3D 0 || 1429 strcmp(PQcmdStatus(results), "ROLLBACK") =3D=3D 0)) 1430 svptcmd =3D NULL; It's right: this is dead code because all paths through the if-nest starting at line 1373 now leave results =3D 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