summaryrefslogtreecommitdiff
path: root/mysql-test/r/trigger.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/trigger.result')
-rw-r--r--mysql-test/r/trigger.result64
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 17a1af9d74b..98208cdfbeb 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -2060,4 +2060,68 @@ ERROR 42S02: Table 'test.a_nonextisting_table' doesn't exist
SELECT * FROM t2;
a b
DROP TABLE t1, t2;
+#
+# Bug#51650 crash with user variables and triggers
+#
+DROP TRIGGER IF EXISTS trg1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (b VARCHAR(50) NOT NULL);
+CREATE TABLE t2 (a VARCHAR(10) NOT NULL DEFAULT '');
+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//
+SET @bug51650 = 1;
+INSERT IGNORE INTO t2 VALUES();
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+INSERT IGNORE INTO t1 SET b = '777';
+INSERT IGNORE INTO t2 SET a = '111';
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+SET @bug51650 = 1;
+INSERT IGNORE INTO t2 SET a = '777';
+DROP TRIGGER trg1;
+DROP TABLE t1, t2;
+CREATE TABLE t1 (id INT NOT NULL);
+CREATE TABLE t2 (id INT NOT NULL);
+INSERT t1 VALUES (1),(2),(3);
+UPDATE t1 SET id=NULL;
+Warnings:
+Warning 1048 Column 'id' cannot be null
+Warning 1048 Column 'id' cannot be null
+Warning 1048 Column 'id' cannot be null
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+INSERT INTO t2 VALUES (3);
+UPDATE t1 SET id=NULL;
+Warnings:
+Warning 1048 Column 'id' cannot be null
+Warning 1048 Column 'id' cannot be null
+Warning 1048 Column 'id' cannot be null
+DROP TRIGGER t1_bu;
+DROP TABLE t1,t2;
+#
+# Bug#50755: Crash if stored routine def contains version comments
+#
+DROP DATABASE IF EXISTS db1;
+DROP TRIGGER IF EXISTS trg1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (b INT);
+CREATE TABLE t2 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1);
+# Used to crash
+SHOW TRIGGERS IN db1;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+Warnings:
+Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
+INSERT INTO t2 VALUES (1);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
+SELECT * FROM t1;
+b
+# Work around Bug#45235
+DROP DATABASE db1;
+USE test;
End of 5.1 tests.