Skip to content

Commit

Permalink
MDEV-32219 Shift/reduce grammar conflict: GRANT .. ON FUNCTION
Browse files Browse the repository at this point in the history
Resolving the shift/reduce conflict conflict in:

GRANT ..  ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
GRANT ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;

and in

REVOKE ..  ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
REVOKE ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;

using a new %prec directive.
  • Loading branch information
abarkov committed Sep 21, 2023
1 parent 8d9bc61 commit 1988512
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
*/

%ifdef MARIADB
%expect 64
%expect 62
%else
%expect 65
%expect 63
%endif

/*
Expand Down Expand Up @@ -1284,6 +1284,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left PREC_BELOW_IDENTIFIER_OPT_SPECIAL_CASE
%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM USER COMMENT_SYM

%left PREC_BELOW_SP_OBJECT_TYPE
%left FUNCTION_SYM


/*
Tokens that can appear in a token contraction on the second place
Expand Down Expand Up @@ -17358,7 +17361,7 @@ role_name: ident_or_text
grant_role: role_name | current_role ;

opt_table:
/* Empty */
/* Empty */ %prec PREC_BELOW_SP_OBJECT_TYPE
| TABLE_SYM
;

Expand Down

0 comments on commit 1988512

Please sign in to comment.