diff options
author | Michael Paquier | 2025-04-19 23:15:39 +0000 |
---|---|---|
committer | Michael Paquier | 2025-04-19 23:15:39 +0000 |
commit | 5ee7bd944ee812e988a7dee52613ee1c80c13579 (patch) | |
tree | 2059b859f3aba2d492b2f720051940a46bfceb54 | |
parent | d05996340d7a4bc32c464be085727ccddf28376b (diff) |
psql: Fix incorrect status code returned by \getresults
When an invalid number of results is requested for \getresults, the
status code returned by exec_command_getresults() was PSQL_CMD_SKIP_LINE
and not PSQL_CMD_ERROR.
This led to incorrect behaviors, with ON_ERROR_STOP for example.
Reported-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/bin/psql/command.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index a8a13c2b88b..81a5ba844ba 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -1922,7 +1922,7 @@ exec_command_getresults(PsqlScanState scan_state, bool active_branch) if (num_results < 0) { pg_log_error("\\getresults: invalid number of requested results"); - return PSQL_CMD_SKIP_LINE; + return PSQL_CMD_ERROR; } pset.requested_results = num_results; } |