mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +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:
@@ -5706,14 +5706,12 @@ process_backslash_command(PsqlScanState sstate, const char *source)
|
||||
yyscanner = expr_scanner_init(sstate, source, lineno, start_offset,
|
||||
my_command->argv[0]);
|
||||
|
||||
if (expr_yyparse(yyscanner) != 0)
|
||||
if (expr_yyparse(&my_command->expr, yyscanner) != 0)
|
||||
{
|
||||
/* dead code: exit done from syntax_error called by yyerror */
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my_command->expr = expr_parse_result;
|
||||
|
||||
/* Save line, trimming any trailing newline */
|
||||
my_command->first_line =
|
||||
expr_scanner_get_substring(sstate,
|
||||
|
||||
Reference in New Issue
Block a user