Skip to content

Commit cfe020a

Browse files
Dmitry ShulgaDmitry Shulga
Dmitry Shulga
authored and
Dmitry Shulga
committed
This is part 2 of core patch for WL#6030.
This patch: - introduces the dynamic checking that fields in the result table row for INSERT statement don't have default value or isn't set inside BEFORE-trigger; - adds uniform approach to handling warnings/errors if some fields are missed from INSERT statement and these fields doesn't have default values; - handles possible missed fields and set error in Diagnostic_area if strict_mode is set and IGNORE isn't set in INSERT statement; - modifies guint tests: replaces explicit assignement of pointer value to Field::m_null_ptr by call of Field::set_null_ptr(); - adds tests for wl6030.
1 parent 1825f17 commit cfe020a

31 files changed

+4546
-191
lines changed

mysql-test/r/insert_select.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ create table t2(No int not null, Field int not null, Count int not null);
607607
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
608608
Warnings:
609609
Warning 1048 Column 'No' cannot be null
610-
Warning 1048 Column 'No' cannot be null
611610
select * from t2;
612611
No Field Count
613612
0 1 100

mysql-test/r/key.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ UNIQUE (c,i));
160160
INSERT INTO t1 (c) VALUES (NULL),(NULL);
161161
Warnings:
162162
Warning 1048 Column 'c' cannot be null
163-
Warning 1048 Column 'c' cannot be null
164163
SELECT * FROM t1;
165164
c i
166165
1

mysql-test/r/null.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,31 +105,27 @@ ERROR 23000: Column 'a' cannot be null
105105
INSERT INTO t1 (a) values (null),(null);
106106
Warnings:
107107
Warning 1048 Column 'a' cannot be null
108-
Warning 1048 Column 'a' cannot be null
109108
INSERT INTO t1 (b) values (null);
110109
ERROR 23000: Column 'b' cannot be null
111110
INSERT INTO t1 (b) values (1/null);
112111
ERROR 23000: Column 'b' cannot be null
113112
INSERT INTO t1 (b) values (null),(null);
114113
Warnings:
115114
Warning 1048 Column 'b' cannot be null
116-
Warning 1048 Column 'b' cannot be null
117115
INSERT INTO t1 (c) values (null);
118116
ERROR 23000: Column 'c' cannot be null
119117
INSERT INTO t1 (c) values (1/null);
120118
ERROR 23000: Column 'c' cannot be null
121119
INSERT INTO t1 (c) values (null),(null);
122120
Warnings:
123121
Warning 1048 Column 'c' cannot be null
124-
Warning 1048 Column 'c' cannot be null
125122
INSERT INTO t1 (d) values (null);
126123
ERROR 23000: Column 'd' cannot be null
127124
INSERT INTO t1 (d) values (1/null);
128125
ERROR 23000: Column 'd' cannot be null
129126
INSERT INTO t1 (d) values (null),(null);
130127
Warnings:
131128
Warning 1048 Column 'd' cannot be null
132-
Warning 1048 Column 'd' cannot be null
133129
select * from t1;
134130
a b c d
135131
0 0000-00-00 00:00:00 0

0 commit comments

Comments
 (0)