diff options
author | unknown <kroki@mysql.com> | 2006-04-19 14:27:59 +0400 |
---|---|---|
committer | unknown <kroki@mysql.com> | 2006-04-19 14:27:59 +0400 |
commit | e334f82ccd4aa3071a804e498c6eeca437f24f63 (patch) | |
tree | 744a90fcf305f1a15c9a0b8fb392d1c224684fbc /mysql-test/t/trigger.test | |
parent | 7069599748259e59353bce21e8b5ae7cd4b8ff44 (diff) | |
download | mariadb-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/t/trigger.test')
-rw-r--r-- | mysql-test/t/trigger.test | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index a0b67b2204d..e9624ee49b0 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1141,4 +1141,52 @@ SELECT * FROM t1 WHERE conn_id != trigger_conn_id; DROP TRIGGER t1_bi; DROP TABLE t1; + +# +# Bug#6951: Triggers/Traditional: SET @ result wrong +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +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; + +SET @x=2; +--error 1365 +UPDATE t1 SET i1 = @x; +SELECT @x; + +SET SQL_MODE=''; + +SET @x=3; +INSERT INTO t1 VALUES (@x); +SELECT @x; + +SET @x=4; +--error 1365 +UPDATE t1 SET i1 = @x; +SELECT @x; + +SET @@sql_mode=@save_sql_mode; + +DROP TRIGGER t1_ai; +DROP TRIGGER t1_au; +DROP TABLE t1; + # End of 5.0 tests |