summaryrefslogtreecommitdiff
path: root/mysql-test/t/trigger_null-8605.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-01-23 20:40:01 +0100
committerSergei Golubchik <serg@mariadb.org>2016-01-25 22:57:54 +0100
commit5da7c346c7a81c1cb7823e50f32f33f266cd26dd (patch)
tree979bf6d82dbb115910faf200fb9ce7e10aaddf3d /mysql-test/t/trigger_null-8605.test
parent68910e7092a3741fff56632b84f5eb340ef99245 (diff)
downloadmariadb-git-5da7c346c7a81c1cb7823e50f32f33f266cd26dd.tar.gz
MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
Don't compare "field == table->next_number_field" because the field can be special nullable field copy created by the trigger. Compare field_index values instead.
Diffstat (limited to 'mysql-test/t/trigger_null-8605.test')
-rw-r--r--mysql-test/t/trigger_null-8605.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/trigger_null-8605.test b/mysql-test/t/trigger_null-8605.test
index 6861676145f..f4935b9c975 100644
--- a/mysql-test/t/trigger_null-8605.test
+++ b/mysql-test/t/trigger_null-8605.test
@@ -325,3 +325,17 @@ insert t1 values (9, 9, 2);
insert t1 (a,c) values (9, 3);
select * from t1;
drop table t1;
+
+#
+# MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
+#
+set session sql_mode ='no_auto_value_on_zero';
+create table t1 (id int unsigned auto_increment primary key);
+insert t1 values (0);
+select * from t1;
+delete from t1;
+create trigger t1_bi before insert on t1 for each row begin end;
+insert t1 values (0);
+select * from t1;
+drop table t1;
+