summaryrefslogtreecommitdiff
path: root/mysql-test/r/trigger.result
diff options
context:
space:
mode:
authorunknown <kroki@mysql.com>2006-04-19 14:27:59 +0400
committerunknown <kroki@mysql.com>2006-04-19 14:27:59 +0400
commite334f82ccd4aa3071a804e498c6eeca437f24f63 (patch)
tree744a90fcf305f1a15c9a0b8fb392d1c224684fbc /mysql-test/r/trigger.result
parent7069599748259e59353bce21e8b5ae7cd4b8ff44 (diff)
downloadmariadb-git-e334f82ccd4aa3071a804e498c6eeca437f24f63.tar.gz
Bug#6951: Triggers/Traditional: SET @ result wrong
While executing a trigger, we have to set thd->abort_on_warning to the value it had at trigger creation time. mysql-test/r/trigger.result: Add result for bug#6951. mysql-test/t/trigger.test: Add test case for bug#6951. sql/sp_head.cc: While executing a trigger, set thd->abort_on_warning to the value it had at trigger creation time.
Diffstat (limited to 'mysql-test/r/trigger.result')
-rw-r--r--mysql-test/r/trigger.result36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 681b805f547..b8983df1bc5 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -965,3 +965,39 @@ SELECT * FROM t1 WHERE conn_id != trigger_conn_id;
conn_id trigger_conn_id
DROP TRIGGER t1_bi;
DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (i1 INT);
+SET @save_sql_mode=@@sql_mode;
+SET SQL_MODE='';
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+SET @x = 5/0;
+SET SQL_MODE='traditional';
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
+SET @x = 5/0;
+SET @x=1;
+INSERT INTO t1 VALUES (@x);
+SELECT @x;
+@x
+NULL
+SET @x=2;
+UPDATE t1 SET i1 = @x;
+ERROR 22012: Division by 0
+SELECT @x;
+@x
+2
+SET SQL_MODE='';
+SET @x=3;
+INSERT INTO t1 VALUES (@x);
+SELECT @x;
+@x
+NULL
+SET @x=4;
+UPDATE t1 SET i1 = @x;
+ERROR 22012: Division by 0
+SELECT @x;
+@x
+4
+SET @@sql_mode=@save_sql_mode;
+DROP TRIGGER t1_ai;
+DROP TRIGGER t1_au;
+DROP TABLE t1;