1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-13005: Fixing bugs in SEQUENCE, part 3, 5/5

Task 6:
We can find the .frm type of file. If it is sequence then is_sequence
passed to dd_frm_type() will be true. Since there is already a check
to give error message if we trigger is on temporary table or view, an
additional condition is added to check if .frm is sequence
(is_sequence==true) and error message is changed to show
"Trigger's '%-.192s' is view, temporary table or sequence" instead of
"Trigger's '%-.192s' is view or temporary table".
This commit is contained in:
Rucha Deodhar
2022-03-28 15:45:29 +05:30
parent a8e7e7c0b4
commit 2eaaa8874f
8 changed files with 30 additions and 8 deletions

View File

@ -711,3 +711,9 @@ 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;
# Task 6:
CREATE SEQUENCE seq1 START WITH 2;
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
ERROR HY000: Trigger's 'seq1' is view, temporary table or sequence
DROP SEQUENCE seq1;
# End of 10.4 test

View File

@ -545,3 +545,11 @@ CREATE TEMPORARY TABLE s1 (s1 INT);
--error ER_PARSE_ERROR
CREATE TEMPORARY SEQUENCE s1 (s1 INT);
DROP TEMPORARY TABLE s1;
--echo # Task 6:
CREATE SEQUENCE seq1 START WITH 2;
--error ER_TRG_ON_VIEW_OR_TEMP_TABLE
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
DROP SEQUENCE seq1;
--echo # End of 10.4 test