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 ...@@ -14548,27 +14548,23 @@ user: user_maybe_role
/* Keyword that we allow for identifiers (except SP labels) */ /* Keyword that we allow for identifiers (except SP labels) */
keyword: keyword:
keyword_sp {} keyword_sp {}
| keyword_sp_verb_clause{}
| ASCII_SYM {} | ASCII_SYM {}
| BACKUP_SYM {} | BACKUP_SYM {}
| BEGIN_SYM {}
| BINLOG_SYM {} | BINLOG_SYM {}
| BYTE_SYM {} | BYTE_SYM {}
| CACHE_SYM {} | CACHE_SYM {}
| CHARSET {} | CHARSET {}
| CHECKSUM_SYM {} | CHECKSUM_SYM {}
| CHECKPOINT_SYM {} | CHECKPOINT_SYM {}
| CLOSE_SYM {}
| COLUMN_ADD_SYM {} | COLUMN_ADD_SYM {}
| COLUMN_CHECK_SYM {} | COLUMN_CHECK_SYM {}
| COLUMN_CREATE_SYM {} | COLUMN_CREATE_SYM {}
| COLUMN_DELETE_SYM {} | COLUMN_DELETE_SYM {}
| COLUMN_GET_SYM {} | COLUMN_GET_SYM {}
| COMMENT_SYM {} | COMMENT_SYM {}
| COMMIT_SYM {}
| CONTAINS_SYM {} | CONTAINS_SYM {}
| DEALLOCATE_SYM {} | DEALLOCATE_SYM {}
| DO_SYM {}
| END {}
| EXAMINED_SYM {} | EXAMINED_SYM {}
| EXCLUDE_SYM {} | EXCLUDE_SYM {}
| EXECUTE_SYM {} | EXECUTE_SYM {}
...@@ -14577,13 +14573,11 @@ keyword: ...@@ -14577,13 +14573,11 @@ keyword:
| FOLLOWING_SYM {} | FOLLOWING_SYM {}
| FORMAT_SYM {} | FORMAT_SYM {}
| GET_SYM {} | GET_SYM {}
| HANDLER_SYM {}
| HELP_SYM {} | HELP_SYM {}
| HOST_SYM {} | HOST_SYM {}
| INSTALL_SYM {} | INSTALL_SYM {}
| LANGUAGE_SYM {} | LANGUAGE_SYM {}
| NO_SYM {} | NO_SYM {}
| OPEN_SYM {}
| OPTION {} | OPTION {}
| OPTIONS_SYM {} | OPTIONS_SYM {}
| OTHERS_SYM {} | OTHERS_SYM {}
...@@ -14594,14 +14588,10 @@ keyword: ...@@ -14594,14 +14588,10 @@ keyword:
| PRECEDING_SYM {} | PRECEDING_SYM {}
| PREPARE_SYM {} | PREPARE_SYM {}
| REMOVE_SYM {} | REMOVE_SYM {}
| REPAIR {}
| RESET_SYM {} | RESET_SYM {}
| RESTORE_SYM {} | RESTORE_SYM {}
| ROLLBACK_SYM {}
| SAVEPOINT_SYM {}
| SECURITY_SYM {} | SECURITY_SYM {}
| SERVER_SYM {} | SERVER_SYM {}
| SHUTDOWN {}
| SIGNED_SYM {} | SIGNED_SYM {}
| SOCKET_SYM {} | SOCKET_SYM {}
| SLAVE {} | SLAVE {}
...@@ -14611,7 +14601,6 @@ keyword: ...@@ -14611,7 +14601,6 @@ keyword:
| STOP_SYM {} | STOP_SYM {}
| STORED_SYM {} | STORED_SYM {}
| TIES_SYM {} | TIES_SYM {}
| TRUNCATE_SYM {}
| UNICODE_SYM {} | UNICODE_SYM {}
| UNINSTALL_SYM {} | UNINSTALL_SYM {}
| UNBOUNDED_SYM {} | UNBOUNDED_SYM {}
...@@ -14632,6 +14621,29 @@ keyword_sp: ...@@ -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, These keywords are generally allowed as identifiers,
but not allowed as non-delimited SP variable names in sql_mode=ORACLE. but not allowed as non-delimited SP variable names in sql_mode=ORACLE.
...@@ -14647,6 +14659,7 @@ keyword_sp_data_type: ...@@ -14647,6 +14659,7 @@ keyword_sp_data_type:
| FIXED_SYM {} | FIXED_SYM {}
| GEOMETRYCOLLECTION {} | GEOMETRYCOLLECTION {}
| GEOMETRY_SYM {} | GEOMETRY_SYM {}
| JSON_SYM {}
| LINESTRING {} | LINESTRING {}
| MEDIUM_SYM {} | MEDIUM_SYM {}
| MULTILINESTRING {} | MULTILINESTRING {}
...@@ -14785,7 +14798,6 @@ keyword_sp_not_data_type: ...@@ -14785,7 +14798,6 @@ keyword_sp_not_data_type:
| ISOLATION {} | ISOLATION {}
| ISOPEN_SYM {} | ISOPEN_SYM {}
| ISSUER_SYM {} | ISSUER_SYM {}
| JSON_SYM {}
| INSERT_METHOD {} | INSERT_METHOD {}
| KEY_BLOCK_SIZE {} | KEY_BLOCK_SIZE {}
| LAST_VALUE {} | LAST_VALUE {}
......
...@@ -14800,20 +14800,9 @@ keyword_directly_not_assignable: ...@@ -14800,20 +14800,9 @@ keyword_directly_not_assignable:
| LANGUAGE_SYM { /* SP characteristic */ } | LANGUAGE_SYM { /* SP characteristic */ }
| NO_SYM { /* SP characteristic */ } | NO_SYM { /* SP characteristic */ }
| CHARSET { /* SET CHARSET utf8; */ } | 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 */} | FOLLOWS_SYM { /* Conflicts with assignment in FOR EACH */}
| PRECEDES_SYM { /* Conflicts with assignment in FOR EACH */} | PRECEDES_SYM { /* Conflicts with assignment in FOR EACH */}
| COMMIT_SYM { /* Verb clause. Reserved in Oracle */ } | keyword_sp_verb_clause
| ROLLBACK_SYM { /* Verb clause. Reserver in Oracle */ }
| SHUTDOWN { /* Verb clause */ }
; ;
/* /*
...@@ -14828,6 +14817,29 @@ keyword_sp: ...@@ -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, These keywords are generally allowed as identifiers,
but not allowed as non-delimited SP variable names in sql_mode=ORACLE. 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