psql: count every COPY FROM STDIN when scanning a query string. When SendQuery() is not told how many COPY FROM STDIN commands the query string contains (as for -c, \gexec, and \watch), it scans the string to count them itself. But it called psql_scan() only once, which stops at the first semicolon, so any COPY FROM STDIN past the first sub-command was not counted, causing failure of cases that used to work. Oversight in commit 3045a25ba.
Author: Zsolt Parragi <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/can4czfpqa6c+u4ux5jj8lanhtq4dxm3m4_8g9wmx_a4-2wu...@mail.gmail.com Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f1204c1a798565c24f645503c43135a1372e9d2b Modified Files -------------- src/bin/psql/common.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
