diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-03-29 03:32:30 +0100 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-03-29 03:32:30 +0100 |
commit | 28e95ba535e175dc696fe7a739736ae9bf2a2b36 (patch) | |
tree | 6d2d62ce4463efb41a7a237232d44360c9cce500 /mysql-test/r/trigger.result | |
parent | 454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (diff) | |
download | mariadb-git-28e95ba535e175dc696fe7a739736ae9bf2a2b36.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/r/trigger.result')
-rw-r--r-- | mysql-test/r/trigger.result | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 5758f5b93d7..3446babbb52 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -2111,4 +2111,21 @@ 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; End of 5.1 tests. |