diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-02-22 15:32:41 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:02:58 +0400 |
commit | 7ca2f816a8f83f7e826191621a9e85ff932dc2cb (patch) | |
tree | 12fddf3a0ea2a45902e4f94bb0ebd01fa845db42 /sql | |
parent | 29e7cf01c3edd638c2bd567d49d053598b442044 (diff) | |
download | mariadb-git-7ca2f816a8f83f7e826191621a9e85ff932dc2cb.tar.gz |
Part#2 for MDEV-12107 sql_mode=ORACLE: Inside routines the CALL keywoard is optional
Allowing qualified procedure names to be used without the CALL keyword:
BEGIN
test.p1(10);
test.p2;
END;
Note:
- COMMIT and ROLLBACK cannot be used in a direct assignment anymore:
COMMIT:= 10;
ROLLBACK:= 10;
But as they are reserved keywords in Oracle anyway, this is not a problem.
- SHUTDOWN now also cannot be used in direct a direct assignment:
SHUTDOWN:=10;
If this causes migration problems in the future, the grammar should
be modified.
Note:
Variables with names COMMIT, ROLLBACK and SHUTDOWN can still be assigned
with the SET statement, e.g. SET COMMIT=10;
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_yacc_ora.yy | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index c31c1e1ef36..e1bf494425e 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -3079,7 +3079,7 @@ sp_proc_stmt_if: sp_statement: statement - | IDENT_sys + | ident_directly_assignable { // Direct procedure call (without the CALL keyword) LEX *lex = Lex; @@ -3090,6 +3090,16 @@ sp_statement: sp_add_used_routine(lex, thd, lex->spname, TYPE_ENUM_PROCEDURE); } opt_sp_cparam_list + | ident_directly_assignable '.' ident + { + LEX *lex = Lex; + if (!(lex->spname= lex->make_sp_name(thd, $1, $3))) + MYSQL_YYABORT; + lex->sql_command= SQLCOM_CALL; + lex->value_list.empty(); + sp_add_used_routine(lex, thd, lex->spname, TYPE_ENUM_PROCEDURE); + } + opt_sp_cparam_list ; sp_proc_stmt_statement: @@ -14317,7 +14327,6 @@ keyword_directly_assignable: | COLUMN_CREATE_SYM {} | COLUMN_DELETE_SYM {} | COLUMN_GET_SYM {} - | COMMIT_SYM {} | DEALLOCATE_SYM {} | EXAMINED_SYM {} | EXCLUDE_SYM {} @@ -14339,10 +14348,8 @@ keyword_directly_assignable: | REMOVE_SYM {} | RESET_SYM {} | RESTORE_SYM {} - | ROLLBACK_SYM {} | SECURITY_SYM {} | SERVER_SYM {} - | SHUTDOWN {} | SIGNED_SYM {} | SOCKET_SYM {} | SLAVE {} @@ -14412,6 +14419,9 @@ keyword_directly_not_assignable: | 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 */ } ; /* |