Remember to reset yy_start state when firing up repl_scanner.l.
authorTom Lane <[email protected]>
Mon, 24 Jan 2022 17:09:46 +0000 (12:09 -0500)
committerTom Lane <[email protected]>
Mon, 24 Jan 2022 17:09:46 +0000 (12:09 -0500)
commitdaf658982889451e6cdb9763482a03656407ae3e
tree93dff04cc233ffa4bd012fa36fcf3bcab04d5b7d
parentd9a81e8671897340dcfec2d2365def9972d917d0
Remember to reset yy_start state when firing up repl_scanner.l.

Without this, we get odd behavior when the previous cycle of
lexing exited in a non-default exclusive state.  Every other
copy of this code is aware that it has to do BEGIN(INITIAL),
but repl_scanner.l did not get that memo.

The real-world impact of this is probably limited, since most
replication clients would abandon their connection after getting
a syntax error.  Still, it's a bug.

This mistake is old, so back-patch to all supported branches.

Discussion: https://postgr.es/m/1874781.1643035952@sss.pgh.pa.us
src/backend/replication/repl_scanner.l