diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-09-14 13:57:14 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-09-14 13:57:14 +0400 |
commit | ca906fb27361f615a1c21d5ae61c312d9ab0dd87 (patch) | |
tree | 71d67279694d4badf492302a3b1e30f09fff653d /mysql-test | |
parent | 2bd6ccae72306547fc89199342584cd4d6e9b939 (diff) | |
download | mariadb-git-ca906fb27361f615a1c21d5ae61c312d9ab0dd87.tar.gz |
MDEV-13686 EXCEPTION reserved keyword in SQL_MODE=oracle but not in Oracle itself
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/compat/oracle/r/sp.result | 15 | ||||
-rw-r--r-- | mysql-test/suite/compat/oracle/t/sp.test | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result index a9158259f4a..97d637c6e1a 100644 --- a/mysql-test/suite/compat/oracle/r/sp.result +++ b/mysql-test/suite/compat/oracle/r/sp.result @@ -273,6 +273,8 @@ CREATE PROCEDURE p1 (rollback OUT INT) AS BEGIN rollback:=10; END;/ ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':=10; END' at line 1 CREATE PROCEDURE p1 (shutdown OUT INT) AS BEGIN shutdown:=10; END;/ ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':=10; END' at line 1 +CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN exception:=10; END;/ +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':=10; END' at line 1 # Testing that keyword_directly_not_assignable works in SET statements. CREATE PROCEDURE p1 (contains OUT INT) AS BEGIN SET contains=10; END;/ DROP PROCEDURE p1/ @@ -300,6 +302,8 @@ CREATE PROCEDURE p1 (begin OUT INT) AS BEGIN SET begin=10; END;/ DROP PROCEDURE p1/ CREATE PROCEDURE p1 (end OUT INT) AS BEGIN SET end=10; END;/ DROP PROCEDURE p1/ +CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN SET exception=10; END;/ +DROP PROCEDURE p1/ # Testing that keyword_directly_not_assignable works in table/column names CREATE TABLE contains (contains INT); DROP TABLE contains; @@ -327,6 +331,8 @@ CREATE TABLE begin (begin INT); DROP TABLE begin; CREATE TABLE end (end INT); DROP TABLE end; +CREATE TABLE exception (exception INT); +DROP TABLE exception; # Testing ELSIF CREATE FUNCTION f1(a INT) RETURN CLOB AS @@ -2282,3 +2288,12 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is def SQL%ROWCOUNT 8 21 1 N 32897 0 63 SQL%ROWCOUNT 0 +# +# MDEV-13686 EXCEPTION reserved keyword in SQL_MODE=oracle but not in Oracle itself +# +CREATE TABLE t1 (c1 int); +CREATE VIEW v1 AS SELECT c1 exception FROM t1; +SELECT exception FROM v1; +exception +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test index 4717ebef8eb..7e9e76d379f 100644 --- a/mysql-test/suite/compat/oracle/t/sp.test +++ b/mysql-test/suite/compat/oracle/t/sp.test @@ -286,6 +286,8 @@ CREATE PROCEDURE p1 (commit OUT INT) AS BEGIN commit:=10; END;/ CREATE PROCEDURE p1 (rollback OUT INT) AS BEGIN rollback:=10; END;/ --error ER_PARSE_ERROR CREATE PROCEDURE p1 (shutdown OUT INT) AS BEGIN shutdown:=10; END;/ +--error ER_PARSE_ERROR +CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN exception:=10; END;/ DELIMITER ;/ @@ -317,6 +319,8 @@ CREATE PROCEDURE p1 (begin OUT INT) AS BEGIN SET begin=10; END;/ DROP PROCEDURE p1/ CREATE PROCEDURE p1 (end OUT INT) AS BEGIN SET end=10; END;/ DROP PROCEDURE p1/ +CREATE PROCEDURE p1 (exception OUT INT) AS BEGIN SET exception=10; END;/ +DROP PROCEDURE p1/ DELIMITER ;/ --echo # Testing that keyword_directly_not_assignable works in table/column names @@ -346,6 +350,8 @@ CREATE TABLE begin (begin INT); DROP TABLE begin; CREATE TABLE end (end INT); DROP TABLE end; +CREATE TABLE exception (exception INT); +DROP TABLE exception; --echo # Testing ELSIF DELIMITER /; @@ -2131,3 +2137,12 @@ DROP PROCEDURE p1; SELECT SQL%ROWCOUNT; --enable_ps_protocol --disable_metadata + +--echo # +--echo # MDEV-13686 EXCEPTION reserved keyword in SQL_MODE=oracle but not in Oracle itself +--echo # +CREATE TABLE t1 (c1 int); +CREATE VIEW v1 AS SELECT c1 exception FROM t1; +SELECT exception FROM v1; +DROP VIEW v1; +DROP TABLE t1; |