Remember to reset yy_start state when firing up repl_scanner.l.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 3c06ec6d1412a6ebf05ee0566b5c05969f0b541f
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-01-24T17:09:46Z
Releases: 15.0
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

Files

PathChange+/−
src/backend/replication/repl_scanner.l modified +3 −0

Discussion