diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-12 12:51:53 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-12 12:51:53 +0300 |
commit | dbbdc4b19691711c82e42c4def5f5325759524c4 (patch) | |
tree | 1d8062b6d5a8ab72361ee3021277a00ca8c6acf1 /mysql-test/t/trigger.test | |
parent | 6e7b8b6a7ab2b58016403304b1c49cf908a6479d (diff) | |
parent | b182c9bd2030c3b3c548157d1bc4c01c306b2c5c (diff) | |
download | mariadb-git-dbbdc4b19691711c82e42c4def5f5325759524c4.tar.gz |
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:
Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/r/explain.result
Text conflict in mysql-test/r/subselect.result
Text conflict in mysql-test/r/subselect3.result
Text conflict in mysql-test/r/type_datetime.result
Text conflict in sql/share/Makefile.am
Diffstat (limited to 'mysql-test/t/trigger.test')
-rw-r--r-- | mysql-test/t/trigger.test | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 3ab724a835a..6fce6c2f630 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -2396,6 +2396,36 @@ SELECT * FROM t2; DROP TABLE t1, t2; +--echo # +--echo # Bug#51650 crash with user variables and triggers +--echo # + +--disable_warnings +DROP TRIGGER IF EXISTS trg1; +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE TABLE t1 (b VARCHAR(50) NOT NULL); +CREATE TABLE t2 (a VARCHAR(10) NOT NULL DEFAULT ''); + +delimiter //; +CREATE TRIGGER trg1 AFTER INSERT ON t2 +FOR EACH ROW BEGIN + SELECT 1 FROM t1 c WHERE + (@bug51650 IS NULL OR @bug51650 != c.b) AND c.b = NEW.a LIMIT 1 INTO @foo; +END// +delimiter ;// + +SET @bug51650 = 1; +INSERT IGNORE INTO t2 VALUES(); +INSERT IGNORE INTO t1 SET b = '777'; +INSERT IGNORE INTO t2 SET a = '111'; +SET @bug51650 = 1; +INSERT IGNORE INTO t2 SET a = '777'; + +DROP TRIGGER trg1; +DROP TABLE t1, t2; + --echo End of 5.1 tests. |