aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/exprscan.l10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bin/pgbench/exprscan.l b/src/bin/pgbench/exprscan.l
index 5c1bd881283..61c20364ed1 100644
--- a/src/bin/pgbench/exprscan.l
+++ b/src/bin/pgbench/exprscan.l
@@ -69,7 +69,7 @@ nonspace [^ \t\r\f\v\n]
newline [\n]
/* Line continuation marker */
-continuation \\{newline}
+continuation \\\r?{newline}
/* case insensitive keywords */
and [Aa][Nn][Dd]
@@ -122,8 +122,12 @@ notnull [Nn][Oo][Tt][Nn][Uu][Ll][Ll]
* a continuation marker just after a word:
*/
{nonspace}+{continuation} {
- /* Found "word\\\n", emit and return just "word" */
- psqlscan_emit(cur_state, yytext, yyleng - 2);
+ /* Found "word\\\r?\n", emit and return just "word" */
+ int wordlen = yyleng - 2;
+ if (yytext[wordlen] == '\r')
+ wordlen--;
+ Assert(yytext[wordlen] == '\\');
+ psqlscan_emit(cur_state, yytext, wordlen);
return 1;
}