Skip to content

Commit 3c06ec6

Browse files
committed
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
1 parent f032f63 commit 3c06ec6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/replication/repl_scanner.l

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ replication_scanner_init(const char *str)
247247
memcpy(scanbuf, str, slen);
248248
scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
249249
scanbufhandle = yy_scan_buffer(scanbuf, slen + 2);
250+
251+
/* Make sure we start in proper state */
252+
BEGIN(INITIAL);
250253
}
251254

252255
void

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy