Commit 42cb3dcb authored by Alexander Barkov's avatar Alexander Barkov

(partial) MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy

Adding keyword_sp_verb_clause into sql_yacc.yy and sql_yacc_ora.yy
parent 77ace5db
......@@ -14548,27 +14548,23 @@ user: user_maybe_role
/* Keyword that we allow for identifiers (except SP labels) */
keyword:
keyword_sp {}
| keyword_sp_verb_clause{}
| ASCII_SYM {}
| BACKUP_SYM {}
| BEGIN_SYM {}
| BINLOG_SYM {}
| BYTE_SYM {}
| CACHE_SYM {}
| CHARSET {}
| CHECKSUM_SYM {}
| CHECKPOINT_SYM {}
| CLOSE_SYM {}
| COLUMN_ADD_SYM {}
| COLUMN_CHECK_SYM {}
| COLUMN_CREATE_SYM {}
| COLUMN_DELETE_SYM {}
| COLUMN_GET_SYM {}
| COMMENT_SYM {}
| COMMIT_SYM {}
| CONTAINS_SYM {}
| DEALLOCATE_SYM {}
| DO_SYM {}
| END {}
| EXAMINED_SYM {}
| EXCLUDE_SYM {}
| EXECUTE_SYM {}
......@@ -14577,13 +14573,11 @@ keyword:
| FOLLOWING_SYM {}
| FORMAT_SYM {}
| GET_SYM {}
| HANDLER_SYM {}
| HELP_SYM {}
| HOST_SYM {}
| INSTALL_SYM {}
| LANGUAGE_SYM {}
| NO_SYM {}
| OPEN_SYM {}
| OPTION {}
| OPTIONS_SYM {}
| OTHERS_SYM {}
......@@ -14594,14 +14588,10 @@ keyword:
| PRECEDING_SYM {}
| PREPARE_SYM {}
| REMOVE_SYM {}
| REPAIR {}
| RESET_SYM {}
| RESTORE_SYM {}
| ROLLBACK_SYM {}
| SAVEPOINT_SYM {}
| SECURITY_SYM {}
| SERVER_SYM {}
| SHUTDOWN {}
| SIGNED_SYM {}
| SOCKET_SYM {}
| SLAVE {}
......@@ -14611,7 +14601,6 @@ keyword:
| STOP_SYM {}
| STORED_SYM {}
| TIES_SYM {}
| TRUNCATE_SYM {}
| UNICODE_SYM {}
| UNINSTALL_SYM {}
| UNBOUNDED_SYM {}
......@@ -14632,6 +14621,29 @@ keyword_sp:
;
/*
Keywords that start a statement.
Generally allowed as identifiers (e.g. table, column names)
- not allowed as SP label names
- not allowed as variable names in Oracle-style assignments:
xxx:=10
*/
keyword_sp_verb_clause:
BEGIN_SYM { /* Compound. Reserved in Oracle */ }
| CLOSE_SYM { /* Verb clause. Reserved in Oracle */ }
| COMMIT_SYM { /* Verb clause. Reserved in Oracle */ }
| DO_SYM { /* Verb clause */ }
| END { /* Compound. Reserved in Oracle */ }
| HANDLER_SYM { /* Verb clause */ }
| OPEN_SYM { /* Verb clause. Reserved in Oracle */ }
| REPAIR { /* Verb clause */ }
| ROLLBACK_SYM { /* Verb clause. Reserved in Oracle */ }
| SAVEPOINT_SYM { /* Verb clause. Reserved in Oracle */ }
| SHUTDOWN { /* Verb clause */ }
| TRUNCATE_SYM { /* Verb clause. Reserved in Oracle */ }
;
/*
These keywords are generally allowed as identifiers,
but not allowed as non-delimited SP variable names in sql_mode=ORACLE.
......@@ -14647,6 +14659,7 @@ keyword_sp_data_type:
| FIXED_SYM {}
| GEOMETRYCOLLECTION {}
| GEOMETRY_SYM {}
| JSON_SYM {}
| LINESTRING {}
| MEDIUM_SYM {}
| MULTILINESTRING {}
......@@ -14785,7 +14798,6 @@ keyword_sp_not_data_type:
| ISOLATION {}
| ISOPEN_SYM {}
| ISSUER_SYM {}
| JSON_SYM {}
| INSERT_METHOD {}
| KEY_BLOCK_SIZE {}
| LAST_VALUE {}
......
......@@ -14800,20 +14800,9 @@ keyword_directly_not_assignable:
| LANGUAGE_SYM { /* SP characteristic */ }
| NO_SYM { /* SP characteristic */ }
| CHARSET { /* SET CHARSET utf8; */ }
| DO_SYM { /* Verb clause */ }
| REPAIR { /* Verb clause */ }
| HANDLER_SYM { /* Verb clause */ }
| CLOSE_SYM { /* Verb clause. Reserved in Oracle */ }
| OPEN_SYM { /* Verb clause. Reserved in Oracle */ }
| SAVEPOINT_SYM { /* Verb clause. Reserved in Oracle */ }
| TRUNCATE_SYM { /* Verb clause. Reserved in Oracle */ }
| BEGIN_SYM { /* Compound. Reserved in Oracle */ }
| END { /* Compound. Reserved in Oracle */ }
| FOLLOWS_SYM { /* Conflicts with assignment in FOR EACH */}
| PRECEDES_SYM { /* Conflicts with assignment in FOR EACH */}
| COMMIT_SYM { /* Verb clause. Reserved in Oracle */ }
| ROLLBACK_SYM { /* Verb clause. Reserver in Oracle */ }
| SHUTDOWN { /* Verb clause */ }
| keyword_sp_verb_clause
;
/*
......@@ -14828,6 +14817,29 @@ keyword_sp:
;
/*
Keywords that start a statement.
Generally allowed as identifiers (e.g. table, column names)
- not allowed as SP label names
- not allowed as variable names in Oracle-style assignments:
xxx:=10
*/
keyword_sp_verb_clause:
BEGIN_SYM { /* Compound. Reserved in Oracle */ }
| CLOSE_SYM { /* Verb clause. Reserved in Oracle */ }
| COMMIT_SYM { /* Verb clause. Reserved in Oracle */ }
| DO_SYM { /* Verb clause */ }
| END { /* Compound. Reserved in Oracle */ }
| HANDLER_SYM { /* Verb clause */ }
| OPEN_SYM { /* Verb clause. Reserved in Oracle */ }
| REPAIR { /* Verb clause */ }
| ROLLBACK_SYM { /* Verb clause. Reserved in Oracle */ }
| SAVEPOINT_SYM { /* Verb clause. Reserved in Oracle */ }
| SHUTDOWN { /* Verb clause */ }
| TRUNCATE_SYM { /* Verb clause. Reserved in Oracle */ }
;
/*
These keywords are generally allowed as identifiers,
but not allowed as non-delimited SP variable names in sql_mode=ORACLE.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment