diff options
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 # |