diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-06-07 16:23:47 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-06-07 16:23:47 +0400 |
commit | fad348a9a69211351c3b27b21ba03ef910c8f623 (patch) | |
tree | 87baa2f348d5c2f8c36920e065a72b7d2c709f2a /mysql-test/suite/compat | |
parent | 4612cb88fa8b391812db44327040a5878e5dbc44 (diff) | |
download | mariadb-git-fad348a9a69211351c3b27b21ba03ef910c8f623.tar.gz |
MDEV-22822 sql_mode="oracle" cannot declare without variable errors
Diffstat (limited to 'mysql-test/suite/compat')
-rw-r--r-- | mysql-test/suite/compat/oracle/r/parser.result | 34 | ||||
-rw-r--r-- | mysql-test/suite/compat/oracle/t/parser.test | 47 |
2 files changed, 81 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/oracle/r/parser.result b/mysql-test/suite/compat/oracle/r/parser.result index 1c60c1434a3..0b573027c6d 100644 --- a/mysql-test/suite/compat/oracle/r/parser.result +++ b/mysql-test/suite/compat/oracle/r/parser.result @@ -607,5 +607,39 @@ ERROR HY000: Unknown system variable 'password' SELECT @@GLOBAL.role; ERROR HY000: Unknown system variable 'role' # +# MDEV-22822 sql_mode="oracle" cannot declare without variable errors +# +# It's OK to have no declarations between DECLARE and BEGIN. +# +BEGIN +DECLARE +BEGIN +NULL; +END; +EXCEPTION +WHEN OTHERS THEN +NULL; +END; +// +DECLARE +BEGIN +NULL; +EXCEPTION +WHEN OTHERS THEN +NULL; +END; +// +BEGIN +<<lab>> +DECLARE +BEGIN +NULL; +END; +EXCEPTION +WHEN OTHERS THEN +NULL; +END; +// +# # End of 10.3 tests # diff --git a/mysql-test/suite/compat/oracle/t/parser.test b/mysql-test/suite/compat/oracle/t/parser.test index 067fd9beb48..4d558c5d153 100644 --- a/mysql-test/suite/compat/oracle/t/parser.test +++ b/mysql-test/suite/compat/oracle/t/parser.test @@ -410,5 +410,52 @@ SELECT @@GLOBAL.role; --echo # +--echo # MDEV-22822 sql_mode="oracle" cannot declare without variable errors +--echo # +--echo # It's OK to have no declarations between DECLARE and BEGIN. +--echo # + +DELIMITER //; +BEGIN + DECLARE + BEGIN + NULL; + END; +EXCEPTION +WHEN OTHERS THEN + NULL; +END; +// +DELIMITER ;// + + +DELIMITER //; +DECLARE +BEGIN + NULL; +EXCEPTION +WHEN OTHERS THEN + NULL; +END; +// +DELIMITER ;// + + +DELIMITER //; +BEGIN +<<lab>> + DECLARE + BEGIN + NULL; + END; +EXCEPTION +WHEN OTHERS THEN + NULL; +END; +// +DELIMITER ;// + + +--echo # --echo # End of 10.3 tests --echo # |