diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2015-11-17 00:42:18 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2015-11-17 22:09:42 +0400 |
commit | 836275bb203a47104eb7f28aa409924b91abc801 (patch) | |
tree | b7ce5ad7a0159c300290af5d3590861c76a9fe3d /mysql-test/t/trigger.test | |
parent | 905613f825f28f561072d6babd307a010de7cf86 (diff) | |
download | mariadb-git-836275bb203a47104eb7f28aa409924b91abc801.tar.gz |
MDEV-4829 BEFORE INSERT triggers dont issue 1406 error.
Turn the 'abort_on_warning' on for assigning value to fields.
Diffstat (limited to 'mysql-test/t/trigger.test')
-rw-r--r-- | mysql-test/t/trigger.test | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 384dd6cdec5..033a197fe10 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -2613,3 +2613,25 @@ DROP TABLE t1, t2; --echo End of 5.3 tests. +# +# MDEV-4829 BEFORE INSERT triggers dont issue 1406 error +# + +SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES'; +CREATE TABLE t1 (c CHAR(1) NOT NULL); +DELIMITER |; +CREATE TRIGGER t1_bi + BEFORE INSERT + ON t1 + FOR EACH ROW + BEGIN + SET NEW.c = 'www'; + END; +| +DELIMITER ;| +SET @@session.sql_mode = default; +--error ER_DATA_TOO_LONG +INSERT INTO t1 VALUES ('a'); +DROP TRIGGER t1_bi; +DROP TABLE t1; + |