Skip to content

Commit

Permalink
Don't bail on #? operator name (#133)
Browse files Browse the repository at this point in the history
The following statement will produce an error with pg_query_parse
while being accepted by PG13.

CREATE OPERATOR #? (LEFTARG=bool,RIGHTARG=bool,FUNCTION=boolge);

#132
  • Loading branch information
svenklemm authored Apr 20, 2022
1 parent 17cf08a commit 9aad9fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patches/02_parser_support_question_mark_as_param_ref.patch
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ index b1ea0cb538..9ba31f418c 100644
+ nchars = 1;
+
+ if (yytext[0] != '?' && strchr(yytext, '?') &&
+ strcmp(yytext, "@?") != 0)
+ strcmp(yytext, "#?") != 0 && strcmp(yytext, "@?") != 0)
+ /* Lex up to just before the ? character */
+ nchars = strchr(yytext, '?') - yytext;
+
Expand Down
2 changes: 1 addition & 1 deletion src/postgres/src_backend_parser_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5664,7 +5664,7 @@ YY_RULE_SETUP
nchars = 1;

if (yytext[0] != '?' && strchr(yytext, '?') &&
strcmp(yytext, "@?") != 0)
strcmp(yytext, "#?") != 0 && strcmp(yytext, "@?") != 0)
/* Lex up to just before the ? character */
nchars = strchr(yytext, '?') - yytext;

Expand Down

0 comments on commit 9aad9fd

Please sign in to comment.