mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +03:00
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 <noah@leadboat.com> Discussion: https://postgr.es/m/20250415213450.1f.nmisch@google.com
This commit is contained in:
@ -1922,7 +1922,7 @@ exec_command_getresults(PsqlScanState scan_state, bool active_branch)
|
|||||||
if (num_results < 0)
|
if (num_results < 0)
|
||||||
{
|
{
|
||||||
pg_log_error("\\getresults: invalid number of requested results");
|
pg_log_error("\\getresults: invalid number of requested results");
|
||||||
return PSQL_CMD_SKIP_LINE;
|
return PSQL_CMD_ERROR;
|
||||||
}
|
}
|
||||||
pset.requested_results = num_results;
|
pset.requested_results = num_results;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user