mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
psql: Avoid some spurious output if the server croaks.
Fixes a regression in commit 08146775ac
.
Noah Misch
This commit is contained in:
parent
1673122127
commit
cf7026b64b
@ -740,7 +740,7 @@ ProcessResult(PGresult **results)
|
||||
} while (next_result);
|
||||
|
||||
/* may need this to recover from conn loss during COPY */
|
||||
if (!CheckConnection())
|
||||
if (!first_cycle && !CheckConnection())
|
||||
return false;
|
||||
|
||||
return success;
|
||||
@ -1015,8 +1015,10 @@ SendQuery(const char *query)
|
||||
case PQTRANS_UNKNOWN:
|
||||
default:
|
||||
OK = false;
|
||||
psql_error("unexpected transaction status (%d)\n",
|
||||
transaction_status);
|
||||
/* PQTRANS_UNKNOWN is expected given a broken connection. */
|
||||
if (transaction_status != PQTRANS_UNKNOWN || ConnectionUp())
|
||||
psql_error("unexpected transaction status (%d)\n",
|
||||
transaction_status);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user