summaryrefslogtreecommitdiff
path: root/mysql-test/t/trigger.test
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2010-02-18 17:02:17 +0000
committerTatiana A. Nurnberg <azundris@mysql.com>2010-02-18 17:02:17 +0000
commite0fbc5d248e4d35920553417f13701484b20f622 (patch)
tree568bc7823ed21bc65107fe7c64d7c826060d5ad2 /mysql-test/t/trigger.test
parent141bb7d144e093c860f2183abf220875ee681930 (diff)
downloadmariadb-git-e0fbc5d248e4d35920553417f13701484b20f622.tar.gz
Bug#48525: trigger changes "Column 'id' cannot be null" behaviour
CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL; UPDATE...SET...NULL on NOT NULL fields behaved differently after a trigger. Now distinguishes between IGNORE and ERROR_FOR_NULL and save/restores check-field options. mysql-test/r/trigger.result: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. mysql-test/t/trigger.test: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. sql/field_conv.cc: CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL. Distinguish between the two. sql/sp_head.cc: raise error as needed sql/sql_class.cc: Save and restore check-fields options. sql/sql_class.h: Make room so we can save check-fields options. sql/sql_insert.cc: raise error as needed
Diffstat (limited to 'mysql-test/t/trigger.test')
-rw-r--r--mysql-test/t/trigger.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 1e55f9d5993..db41a12a9ac 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -2396,4 +2396,17 @@ SELECT * FROM t2;
DROP TABLE t1, t2;
+#
+# Bug #48525: trigger changes "Column 'id' cannot be null" behaviour
+#
+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;
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (3);
+UPDATE t1 SET id=NULL;
+DROP TRIGGER t1_bu;
+DROP TABLE t1,t2;
+
--echo End of 5.1 tests.