1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Return yyparse() result not via global variable

Instead of passing the parse result from yyparse() via a global
variable, pass it via a function output argument.

This complements earlier work to make the parsers reentrant.

Discussion: Discussion: https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-01-24 06:55:39 +01:00
parent 6fc4fc42da
commit 473a575e05
18 changed files with 106 additions and 101 deletions

View File

@ -2017,7 +2017,7 @@ exec_replication_command(const char *cmd_string)
/*
* Looks like a WalSender command, so parse it.
*/
parse_rc = replication_yyparse(scanner);
parse_rc = replication_yyparse(&cmd_node, scanner);
if (parse_rc != 0)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
@ -2025,8 +2025,6 @@ exec_replication_command(const char *cmd_string)
parse_rc)));
replication_scanner_finish(scanner);
cmd_node = replication_parse_result;
/*
* Report query to various monitoring facilities. For this purpose, we
* report replication commands just like SQL commands.