summaryrefslogtreecommitdiff
path: root/mysql-test/r/trigger_no_defaults-11698.result
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-03-01 23:52:35 +0100
committerSergei Golubchik <serg@mariadb.org>2017-03-10 18:21:23 +0100
commit5fa04aae9ec94428a68ef4f6f681564111933c11 (patch)
treeaa13afd269157d578b3f2feae53146fa68f224c2 /mysql-test/r/trigger_no_defaults-11698.result
parentb6a1d6538b4d2001be20fe0d8f470874c744f0a2 (diff)
downloadmariadb-git-5fa04aae9ec94428a68ef4f6f681564111933c11.tar.gz
MDEV-11842 Fail to insert on a table where a field has no default
has_no_default_value() should only fail the insert in the strict mode. Additionally, don't check for "all fields are given values" twice, it'll produce duplicate warnings.
Diffstat (limited to 'mysql-test/r/trigger_no_defaults-11698.result')
-rw-r--r--mysql-test/r/trigger_no_defaults-11698.result18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/trigger_no_defaults-11698.result b/mysql-test/r/trigger_no_defaults-11698.result
index 40546cee41d..93672092180 100644
--- a/mysql-test/r/trigger_no_defaults-11698.result
+++ b/mysql-test/r/trigger_no_defaults-11698.result
@@ -20,3 +20,21 @@ a b
10 10
0 30
drop table t1;
+set sql_mode=default;
+create table t1 (
+id int(11) not null auto_increment primary key,
+data1 varchar(10) not null,
+data2 varchar(10) not null
+);
+insert into t1 (data2) values ('x');
+Warnings:
+Warning 1364 Field 'data1' doesn't have a default value
+create trigger test_trigger before insert on t1 for each row begin end;
+insert into t1 (data2) values ('y');
+Warnings:
+Warning 1364 Field 'data1' doesn't have a default value
+select * from t1;
+id data1 data2
+1 x
+2 y
+drop table t1;