summaryrefslogtreecommitdiff
path: root/mysql-test/t/trigger.test
diff options
context:
space:
mode:
authorunknown <gluh@eagle.(none)>2007-02-02 10:25:45 +0400
committerunknown <gluh@eagle.(none)>2007-02-02 10:25:45 +0400
commited0e4a968a4dfba3788bc270c73620f3e498dca5 (patch)
treea499a38ce070d521a711fde73af6cb95e3713dc3 /mysql-test/t/trigger.test
parent4ebef0520629873253ed5007aba1a01c91d7f8fd (diff)
parenta30830460794651c0e9fc5ec4779cf77680514ee (diff)
downloadmariadb-git-ed0e4a968a4dfba3788bc270c73620f3e498dca5.tar.gz
Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt mysql-test/r/distinct.result: Auto merged mysql-test/r/join_nested.result: Auto merged mysql-test/r/null_key.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/subselect3.result: Auto merged mysql-test/r/trigger.result: Auto merged mysql-test/t/select.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/trigger.test: Auto merged sql/filesort.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_sum.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged mysql-test/r/func_time.result: manual merge mysql-test/r/information_schema.result: manual merge mysql-test/t/func_time.test: manual merge mysql-test/t/information_schema.test: manual merge sql/opt_range.cc: manual merge sql/sql_delete.cc: manual merge sql/sql_lex.h: manual merge
Diffstat (limited to 'mysql-test/t/trigger.test')
-rw-r--r--mysql-test/t/trigger.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index b40a8538e04..b6bf8fcb40e 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -1505,6 +1505,31 @@ update t1 set i= i+ 10 where j > 2;
select * from t1;
drop table t1;
+#
+# Bug#23556 TRUNCATE TABLE still maps to DELETE
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+
+CREATE TRIGGER trg_t1 BEFORE DELETE on t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (OLD.a);
+
+FLUSH STATUS;
+TRUNCATE t1;
+SHOW STATUS LIKE 'handler_delete';
+SELECT COUNT(*) FROM t2;
+
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+DELETE FROM t2;
+
+FLUSH STATUS;
+DELETE FROM t1;
+SHOW STATUS LIKE 'handler_delete';
+SELECT COUNT(*) FROM t2;
+
+DROP TRIGGER trg_t1;
+DROP TABLE t1,t2;
#
# Bug #23651 "Server crashes when trigger which uses stored function