From a8e7e7c0b4a66a9e92c03b0fe084e98393bafdce Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Mon, 28 Mar 2022 15:18:42 +0530 Subject: [PATCH] MDEV-13005: Fixing bugs in SEQUENCE, part 3, 4/5 Task 4 and 5: Already fixed when I started working on bug. Task 4 correctly gives syntax error ('(' and ')' are not part of create sequence syntax). Task 5 also gives correct error because s1 is table not sequence. Fails with ER_NOT_SEQUENCE2 --- mysql-test/suite/sql_sequence/create.result | 10 ++++++++++ mysql-test/suite/sql_sequence/create.test | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result index e80400023e7..a2f63042cd6 100644 --- a/mysql-test/suite/sql_sequence/create.result +++ b/mysql-test/suite/sql_sequence/create.result @@ -701,3 +701,13 @@ ERROR HY000: Sequence 'test.x' has out of range value for options # Task 3: CREATE SEQUENCE seq1 START WITH 1 cache -1; ERROR HY000: Sequence 'test.seq1' has out of range value for options +# Task 4: +CREATE TEMPORARY TABLE s1 (s1 INT); +DROP TEMPORARY SEQUENCE s1; +ERROR 42S02: 'test.s1' is not a SEQUENCE +DROP TEMPORARY TABLE s1; +# Task 5: +CREATE TEMPORARY TABLE s1 (s1 INT); +CREATE TEMPORARY SEQUENCE s1 (s1 INT); +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 '(s1 INT)' at line 1 +DROP TEMPORARY TABLE s1; diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test index 766282be781..7e0c8f373dd 100644 --- a/mysql-test/suite/sql_sequence/create.test +++ b/mysql-test/suite/sql_sequence/create.test @@ -533,3 +533,15 @@ CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678; --echo # Task 3: --error ER_SEQUENCE_INVALID_DATA CREATE SEQUENCE seq1 START WITH 1 cache -1; + +--echo # Task 4: +CREATE TEMPORARY TABLE s1 (s1 INT); +--error ER_NOT_SEQUENCE2 +DROP TEMPORARY SEQUENCE s1; +DROP TEMPORARY TABLE s1; + +--echo # Task 5: +CREATE TEMPORARY TABLE s1 (s1 INT); +--error ER_PARSE_ERROR +CREATE TEMPORARY SEQUENCE s1 (s1 INT); +DROP TEMPORARY TABLE s1;