psql: Fix line continuation prompts for unbalanced parentheses
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 29 Apr 2021 07:04:31 +0000 (09:04 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 29 Apr 2021 07:04:31 +0000 (09:04 +0200)
This was broken by a silly mistake in
e717a9a18b2e34c9c40e5259ad4d31cd7e420750.

Reported-by: Jeff Janes <jeff.janes@gmail.com>
Author: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://www.postgresql.org/message-id/CAMkU=1zKGWEJdBbYKw7Tn7cJmYR_UjgdcXTPDqJj=dNwCETBCQ@mail.gmail.com

src/fe_utils/psqlscan.l

index 991b7de0b5546ad37b452e6d420e3aaece5383be..0fab48a38253a060debf282bd83df8e8865589ad 100644 (file)
@@ -1106,7 +1106,7 @@ psql_scan(PsqlScanState state,
                        result = PSCAN_INCOMPLETE;
                        *prompt = PROMPT_PAREN;
                    }
-                   if (state->begin_depth > 0)
+                   else if (state->begin_depth > 0)
                    {
                        result = PSCAN_INCOMPLETE;
                        *prompt = PROMPT_CONTINUE;