14
14
Error 1050 Table 't1' already exists
15
create table t2(a int) default charset qwerty;
16
ERROR 42000: Unknown character set: 'qwerty'
22
Error 1115 Unknown character set: 'qwerty'
15
23
create table t (i);
16
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
24
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
17
25
show count(*) errors;
18
26
@@session.error_count
22
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
30
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
23
31
insert into t1 values (1);
24
32
insert into t1 values ("hej");
25
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
34
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
26
35
insert into t1 values ("hej"),("d�");
27
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
37
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
38
Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
28
39
set SQL_WARNINGS=1;
29
40
insert into t1 values ("hej");
30
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
42
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
31
43
insert into t1 values ("hej"),("d�");
32
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
45
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
46
Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
34
48
set SQL_WARNINGS=0;
35
49
drop temporary table if exists not_exists;
58
create table t1(a int, b int not null, c date, d char(5));
72
create table t1(a tinyint, b int not null, c date, d char(5));
59
73
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
60
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
75
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
76
Warning 1265 Data truncated for column 'd' at row 3
77
Warning 1265 Data truncated for column 'c' at row 4
78
Warning 1261 Row 5 doesn't contain data for all columns
79
Warning 1265 Data truncated for column 'b' at row 6
80
Warning 1262 Row 7 was truncated; it contained more data than there were input columns
81
Warning 1264 Out of range value for column 'a' at row 8
61
82
select @@warning_count;
65
create table t1(a int NOT NULL, b int, c char(5));
66
insert into t1 values(-1,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
67
ERROR 22001: Data too long for column 'c' at row 2
68
insert into t1 values(-1,100,'mysql'),(10,-1,'dri '),(500,256,'zzle'),(20,NULL,'test');
86
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
87
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
89
Warning 1048 Column 'a' cannot be null
90
Warning 1264 Out of range value for column 'b' at row 2
91
Warning 1265 Data truncated for column 'c' at row 2
92
Warning 1264 Out of range value for column 'a' at row 3
93
Warning 1264 Out of range value for column 'b' at row 3
94
Warning 1265 Data truncated for column 'c' at row 3
69
95
alter table t1 modify c char(4);
70
ERROR 01000: Data truncated for column 'c' at row 1
97
Warning 1265 Data truncated for column 'c' at row 1
98
Warning 1265 Data truncated for column 'c' at row 2
71
99
alter table t1 add d char(2);
72
100
update t1 set a=NULL where a=10;
73
101
ERROR 23000: Column 'a' cannot be null
74
update t1 set c='drizzle' where c='test';
75
ERROR 22001: Data too long for column 'c' at row 4
102
update t1 set c='mysql ab' where c='test';
104
Warning 1265 Data truncated for column 'c' at row 4
76
105
update t1 set d=c;
77
ERROR 22001: Data too long for column 'd' at row 1
78
create table t2(a int NOT NULL, b char(3));
107
Warning 1265 Data truncated for column 'd' at row 1
108
Warning 1265 Data truncated for column 'd' at row 2
109
Warning 1265 Data truncated for column 'd' at row 3
110
Warning 1265 Data truncated for column 'd' at row 4
111
create table t2(a tinyint NOT NULL, b char(3));
79
112
insert into t2 select b,c from t1;
80
ERROR 22001: Data too long for column 'b' at row 1
114
Warning 1265 Data truncated for column 'b' at row 1
115
Warning 1265 Data truncated for column 'b' at row 2
116
Warning 1265 Data truncated for column 'b' at row 3
117
Warning 1048 Column 'a' cannot be null
118
Warning 1265 Data truncated for column 'b' at row 4
81
119
insert into t2(b) values('mysqlab');
82
ERROR HY000: Field 'a' doesn't have a default value
83
insert into t2(a) values(1);
121
Warning 1364 Field 'a' doesn't have a default value
122
Warning 1265 Data truncated for column 'b' at row 1
84
123
set sql_warnings=1;
85
insert into t2(a,b) values(1,'mysqlab');
86
ERROR 22001: Data too long for column 'b' at row 1
87
insert into t2(a,b) values(1,'mys');
124
insert into t2(b) values('mysqlab');
126
Warning 1364 Field 'a' doesn't have a default value
127
Warning 1265 Data truncated for column 'b' at row 1
88
128
set sql_warnings=0;
89
129
drop table t1, t2;
90
130
create table t1(a char(10));
91
131
alter table t1 add b char;
92
132
set max_error_count=10;
93
133
update t1 set b=a;
94
ERROR 22001: Data too long for column 'b' at row 1
95
alter table t1 modify b char(10);
135
Warning 1265 Data truncated for column 'b' at row 1
136
Warning 1265 Data truncated for column 'b' at row 2
137
Warning 1265 Data truncated for column 'b' at row 3
138
Warning 1265 Data truncated for column 'b' at row 4
139
Warning 1265 Data truncated for column 'b' at row 5
140
Warning 1265 Data truncated for column 'b' at row 6
141
Warning 1265 Data truncated for column 'b' at row 7
142
Warning 1265 Data truncated for column 'b' at row 8
143
Warning 1265 Data truncated for column 'b' at row 9
144
Warning 1265 Data truncated for column 'b' at row 10
97
145
select @@warning_count;
100
148
set max_error_count=0;
101
149
show variables like 'max_error_count';
102
150
Variable_name Value
103
151
max_error_count 0
104
152
update t1 set b='hi';
105
154
select @@warning_count;
109
158
Level Code Message
110
159
set max_error_count=65535;
119
168
create table t1 (a int);
120
169
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
121
170
update t1 set a='abc';
122
ERROR HY000: Incorrect integer value: 'abc' for column 'a' at row 1
172
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 1
173
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 2
174
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 3
175
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 4
176
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 5
177
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 6
178
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 7
179
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 8
180
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 9
181
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
123
182
show warnings limit 2, 1;
124
183
Level Code Message
184
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 3
125
185
show warnings limit 0, 10;
126
186
Level Code Message
127
Error 1366 Incorrect integer value: 'abc' for column 'a' at row 1
187
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 1
188
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 2
189
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 3
190
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 4
191
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 5
192
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 6
193
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 7
194
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 8
195
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 9
196
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
128
197
show warnings limit 9, 1;
129
198
Level Code Message
199
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
130
200
show warnings limit 10, 1;
131
201
Level Code Message
132
202
show warnings limit 9, 2;
133
203
Level Code Message
204
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
134
205
show warnings limit 0, 0;
135
206
Level Code Message
136
207
show warnings limit 1;
137
208
Level Code Message
138
Error 1366 Incorrect integer value: 'abc' for column 'a' at row 1
209
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 1
139
210
show warnings limit 0;
140
211
Level Code Message
141
212
show warnings limit 1, 0;
151
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
222
CREATE TABLE t1( f1 CHAR(20) );
223
CREATE TABLE t2( f1 CHAR(20), f2 CHAR(25) );
224
CREATE TABLE t3( f1 CHAR(20), f2 CHAR(25), f3 DATE );
225
INSERT INTO t1 VALUES ( 'a`' );
226
INSERT INTO t2 VALUES ( 'a`', 'a`' );
227
INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
228
DROP PROCEDURE IF EXISTS sp1;
230
Note 1305 PROCEDURE sp1 does not exist
231
DROP PROCEDURE IF EXISTS sp2;
233
Note 1305 PROCEDURE sp2 does not exist
234
DROP PROCEDURE IF EXISTS sp3;
236
Note 1305 PROCEDURE sp3 does not exist
237
CREATE PROCEDURE sp1()
239
DECLARE x NUMERIC ZEROFILL;
240
SELECT f1 INTO x FROM t1 LIMIT 1;
242
CREATE PROCEDURE sp2()
244
DECLARE x NUMERIC ZEROFILL;
245
SELECT f1 INTO x FROM t2 LIMIT 1;
247
CREATE PROCEDURE sp3()
249
DECLARE x NUMERIC ZEROFILL;
250
SELECT f1 INTO x FROM t3 LIMIT 1;
254
Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
257
Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
260
Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
261
DROP PROCEDURE IF EXISTS sp1;
262
CREATE PROCEDURE sp1()
264
declare x numeric unsigned zerofill;
265
SELECT f1 into x from t2 limit 1;
269
Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
276
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext tinytext);
277
create table t2 (c_tinyblob tinyblob);
152
278
set @c = repeat(' ', 256);
153
279
set @q = repeat('q', 256);
154
insert into t1 values(@c, @c, @c);
156
Note 1265 Data truncated for column 'c_char' at row 1
157
Note 1265 Data truncated for column 'c_varchar' at row 1
160
Note 1265 Data truncated for column 'c_char' at row 1
161
Note 1265 Data truncated for column 'c_varchar' at row 1
281
insert into t1 values(@c, @c, @c);
283
Note 1265 Data truncated for column 'c_char' at row 1
284
Note 1265 Data truncated for column 'c_varchar' at row 1
285
Note 1265 Data truncated for column 'c_tinytext' at row 1
286
insert into t2 values(@c);
288
Warning 1265 Data truncated for column 'c_tinyblob' at row 1
289
insert into t1 values(@q, @q, @q);
291
Warning 1265 Data truncated for column 'c_char' at row 1
292
Warning 1265 Data truncated for column 'c_varchar' at row 1
293
Warning 1265 Data truncated for column 'c_tinytext' at row 1
294
insert into t2 values(@q);
296
Warning 1265 Data truncated for column 'c_tinyblob' at row 1
297
set sql_mode = 'traditional';
298
insert into t1 values(@c, @c, @c);
300
Note 1265 Data truncated for column 'c_char' at row 1
301
Note 1265 Data truncated for column 'c_varchar' at row 1
302
Note 1265 Data truncated for column 'c_tinytext' at row 1
303
insert into t2 values(@c);
304
ERROR 22001: Data too long for column 'c_tinyblob' at row 1
162
305
insert into t1 values(@q, NULL, NULL);
163
306
ERROR 22001: Data too long for column 'c_char' at row 1
164
307
insert into t1 values(NULL, @q, NULL);
165
308
ERROR 22001: Data too long for column 'c_varchar' at row 1
166
309
insert into t1 values(NULL, NULL, @q);
310
ERROR 22001: Data too long for column 'c_tinytext' at row 1
311
insert into t2 values(@q);
312
ERROR 22001: Data too long for column 'c_tinyblob' at row 1