summaryrefslogtreecommitdiff
path: root/mysql-test/t/trigger-compat.test
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-10-02 15:35:08 +0300
committerMonty <monty@mariadb.org>2016-10-05 01:11:07 +0300
commit8be53a389c8eebed337057fa366b7c4506ba16b1 (patch)
treeabd36c95a598f1d6e5537e94fd7de034715ce299 /mysql-test/t/trigger-compat.test
parent0bae1957dd124f8382ae6af1de0e2168fc200bfb (diff)
downloadmariadb-git-8be53a389c8eebed337057fa366b7c4506ba16b1.tar.gz
MDEV-6112 multiple triggers per table
This is similar to MysQL Worklog 3253, but with a different implementation. The disk format and SQL syntax is identical with MySQL 5.7. Fetures supported: - "Any" ammount of any trigger - Supports FOLLOWS and PRECEDES to be able to put triggers in a certain execution order. Implementation details: - Class Trigger added to hold information about a trigger. Before this trigger information was stored in a set of lists in Table_triggers_list and in Table_triggers_list::bodies - Each Trigger has a next field that poinst to the next Trigger with the same action and time. - When accessing a trigger, we now always access all linked triggers - The list are now only used to load and save trigger files. - MySQL trigger test case (trigger_wl3253) added and we execute these identically. - Even more gracefully handling of wrong trigger files than before. This is useful if a trigger file uses functions or syntax not provided by the server. - Each trigger now has a "Created" field that shows when the trigger was created, with 2 decimals. Other comments: - Many of the changes in test files was done because of the new "Created" field in the trigger file. This shows up in SHOW ... TRIGGER and when using information_schema.trigger. - Don't check if all memory is released if on uses --gdb; This is needed to be able to get a list from safemalloc of not freed memory while debugging. - Added option to trim_whitespace() to know how many prefix characters was skipped. - Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage of sql_mode.
Diffstat (limited to 'mysql-test/t/trigger-compat.test')
-rw-r--r--mysql-test/t/trigger-compat.test6
1 files changed, 5 insertions, 1 deletions
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index 2d949b0c91e..437df89b4b1 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -90,6 +90,7 @@ SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_n
--echo
+--replace_column 17 #
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
# Clean up
@@ -181,6 +182,7 @@ FLUSH TABLE t2;
CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
--error ER_PARSE_ERROR
CREATE TRIGGER tr22 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM non_existing_table;
+--replace_column 6 #
SHOW TRIGGERS;
--error ER_PARSE_ERROR
INSERT INTO t1 VALUES (1);
@@ -193,6 +195,7 @@ UPDATE t1 SET a = 1 WHERE a = 1;
SELECT * FROM t1;
--error ER_PARSE_ERROR
RENAME TABLE t1 TO t1_2;
+--replace_column 6 #
SHOW TRIGGERS;
DROP TRIGGER tr11;
@@ -201,6 +204,7 @@ DROP TRIGGER tr13;
DROP TRIGGER tr14;
DROP TRIGGER tr15;
+--replace_column 6 #
SHOW TRIGGERS;
--echo # Make sure there is no trigger file left.
@@ -257,7 +261,7 @@ INSERT INTO t2 VALUES (1), (2), (3);
--echo # We write three trigger files. First trigger is syntaxically incorrect, next trigger is correct
--echo # and last trigger is broken.
---echo # Next we try to execute SHOW CREATE TRGGIR command for broken trigger and then try to drop one.
+--echo # Next we try to execute SHOW CREATE TRIGGER command for broken trigger and then try to drop one.
--write_file $MYSQLD_DATADIR/test/tr11.TRN
TYPE=TRIGGERNAME
trigger_table=t1