1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +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

@@ -996,13 +996,13 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source)
int parse_rc;
SyncRepConfigData *pconf;
/* Reset communication variables to ensure a fresh start */
syncrep_parse_result = NULL;
syncrep_parse_error_msg = NULL;
/* Result of parsing is returned in one of these two variables */
SyncRepConfigData *syncrep_parse_result = NULL;
char *syncrep_parse_error_msg = NULL;
/* Parse the synchronous_standby_names string */
syncrep_scanner_init(*newval, &scanner);
parse_rc = syncrep_yyparse(scanner);
parse_rc = syncrep_yyparse(&syncrep_parse_result, &syncrep_parse_error_msg, scanner);
syncrep_scanner_finish(scanner);
if (parse_rc != 0 || syncrep_parse_result == NULL)