psql: Add ignore_slash_options in bind's inactive branch
commit04c0897d3bcafe4ca61967d5ab1b5669f3cbe80b
authorMichael Paquier <michael@paquier.xyz>
Fri, 19 Jan 2024 05:18:20 +0000 (19 14:18 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 19 Jan 2024 05:18:20 +0000 (19 14:18 +0900)
tree51a0e97f67944d6d75c9087f0a3f231c7fa4eec0
parent3ada0d2cae4d9d3e045c72e3ee0b37ccb6e13902
psql: Add ignore_slash_options in bind's inactive branch

All commands accepting arguments, handling them with OT_NORMAL, OT_SQLID
or OT_SQLIDHACK, should call ignore_slash_options() in inactive branch
to scan and discard extra arguments.  All the backslash commands that
handle arguments do so, except \bind.

This commit adds the missing ignore_slash_options to \bind's inactive
branch.  This inconsistency is a logic bug, however the behavior happens
to be unchanged as any extra arguments are discarded later in
HandleSlashCmds(), so no backpatch is done.

While on it, this adds \bind to the list of backslash commands where
inactive \if branches are checked in the tests for psql.

Reported-by: Jelte Fennema-Nio
Author: Anthonin Bonnefoy
Discussion: https://postgr.es/m/CAGECzQR1+udGKz+FbHiCQ7CWDiF1fCGi2xYuvQUODdMAfJbaLA@mail.gmail.com
src/bin/psql/command.c
src/test/regress/expected/psql.out
src/test/regress/sql/psql.sql