diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 3fb29f8..eb0e8ac 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -810,6 +810,7 @@ pgbench options dbname Script file meta commands begin with a backslash (\) and extend to the end of the line. + They can spread over several lines with backslash-return continuations. Arguments to a meta command are separated by white space. These meta commands are supported: @@ -838,7 +839,8 @@ pgbench options dbname Examples: \set ntellers 10 * :scale -\set aid (1021 * random(1, 100000 * :scale)) % (100000 * :scale) + 1 +\set aid (1021 * random(1, 100000 * :scale)) % \ + (100000 * :scale) + 1 diff --git a/src/bin/pgbench/exprscan.l b/src/bin/pgbench/exprscan.l index 9a3be3d..33cc1ea 100644 --- a/src/bin/pgbench/exprscan.l +++ b/src/bin/pgbench/exprscan.l @@ -65,6 +65,7 @@ alnum [a-zA-Z0-9_] space [ \t\r\f\v] nonspace [^ \t\r\f\v\n] newline [\n] +continuation \\{newline} /* Exclusive states */ %x EXPR @@ -104,6 +105,8 @@ newline [\n] return 0; } +{continuation} { /* ignore */ } + /* EXPR state */ { @@ -138,6 +141,8 @@ newline [\n] return FUNCTION; } +{continuation} { /* ignore */ } + {newline} { /* report end of command */ last_was_newline = true;