diff options
| author | Peter Eisentraut | 2025-01-24 05:55:39 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2025-01-24 05:55:39 +0000 |
| commit | 473a575e05979b4dbb28b3f2544f4ec8f184ce65 (patch) | |
| tree | ccc231a6e062094a190685fff1a6ce43063c8a3f /src/include | |
| parent | 6fc4fc42da07c47a9b8d014ab18d005cf8b3e176 (diff) | |
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
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/replication/syncrep.h | 10 | ||||
| -rw-r--r-- | src/include/replication/walsender_private.h | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h index 33b9cdb18f7..675669a79f7 100644 --- a/src/include/replication/syncrep.h +++ b/src/include/replication/syncrep.h @@ -73,10 +73,6 @@ typedef struct SyncRepConfigData extern PGDLLIMPORT SyncRepConfigData *SyncRepConfig; -/* communication variables for parsing synchronous_standby_names GUC */ -extern PGDLLIMPORT SyncRepConfigData *syncrep_parse_result; -extern PGDLLIMPORT char *syncrep_parse_error_msg; - /* user-settable parameters for synchronous replication */ extern PGDLLIMPORT char *SyncRepStandbyNames; @@ -105,9 +101,9 @@ union YYSTYPE; #define YY_TYPEDEF_YY_SCANNER_T typedef void *yyscan_t; #endif -extern int syncrep_yyparse(yyscan_t yyscanner); -extern int syncrep_yylex(union YYSTYPE *yylval_param, yyscan_t yyscanner); -extern void syncrep_yyerror(yyscan_t yyscanner, const char *str); +extern int syncrep_yyparse(SyncRepConfigData **syncrep_parse_result_p, char **syncrep_parse_error_msg_p, yyscan_t yyscanner); +extern int syncrep_yylex(union YYSTYPE *yylval_param, char **syncrep_parse_error_msg_p, yyscan_t yyscanner); +extern void syncrep_yyerror(SyncRepConfigData **syncrep_parse_result_p, char **syncrep_parse_error_msg_p, yyscan_t yyscanner, const char *str); extern void syncrep_scanner_init(const char *str, yyscan_t *yyscannerp); extern void syncrep_scanner_finish(yyscan_t yyscanner); diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h index 5ab96ed5f7d..814b812432a 100644 --- a/src/include/replication/walsender_private.h +++ b/src/include/replication/walsender_private.h @@ -130,13 +130,11 @@ union YYSTYPE; #define YY_TYPEDEF_YY_SCANNER_T typedef void *yyscan_t; #endif -extern int replication_yyparse(yyscan_t yyscanner); +extern int replication_yyparse(Node **replication_parse_result_p, yyscan_t yyscanner); extern int replication_yylex(union YYSTYPE *yylval_param, yyscan_t yyscanner); -extern void replication_yyerror(yyscan_t yyscanner, const char *message) pg_attribute_noreturn(); +extern void replication_yyerror(Node **replication_parse_result_p, yyscan_t yyscanner, const char *message) pg_attribute_noreturn(); extern void replication_scanner_init(const char *str, yyscan_t *yyscannerp); extern void replication_scanner_finish(yyscan_t yyscanner); extern bool replication_scanner_is_replication_command(yyscan_t yyscanner); -extern PGDLLIMPORT Node *replication_parse_result; - #endif /* _WALSENDER_PRIVATE_H */ |
