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'
23
15
create table t (i);
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
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
25
17
show count(*) errors;
26
18
@@session.error_count
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
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
31
23
insert into t1 values (1);
32
24
insert into t1 values ("hej");
34
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
25
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
35
26
insert into t1 values ("hej"),("d�");
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
27
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
39
28
set SQL_WARNINGS=1;
40
29
insert into t1 values ("hej");
42
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
30
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
43
31
insert into t1 values ("hej"),("d�");
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
32
ERROR HY000: Incorrect integer value: 'hej' for column 'a' at row 1
48
34
set SQL_WARNINGS=0;
49
35
drop temporary table if exists not_exists;
72
create table t1(a tinyint, b int not null, c date, d char(5));
58
create table t1(a int, b int not null, c date, d char(5));
73
59
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
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
60
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
82
61
select @@warning_count;
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
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');
95
69
alter table t1 modify c char(4);
97
Warning 1265 Data truncated for column 'c' at row 1
98
Warning 1265 Data truncated for column 'c' at row 2
70
ERROR 01000: Data truncated for column 'c' at row 1
99
71
alter table t1 add d char(2);
100
72
update t1 set a=NULL where a=10;
101
73
ERROR 23000: Column 'a' cannot be null
102
update t1 set c='mysql ab' where c='test';
104
Warning 1265 Data truncated for column 'c' at row 4
74
update t1 set c='drizzle' where c='test';
75
ERROR 22001: Data too long for column 'c' at row 4
105
76
update t1 set d=c;
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));
77
ERROR 22001: Data too long for column 'd' at row 1
78
create table t2(a int NOT NULL, b char(3));
112
79
insert into t2 select b,c from t1;
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
80
ERROR 22001: Data too long for column 'b' at row 1
119
81
insert into t2(b) values('mysqlab');
121
Warning 1364 Field 'a' doesn't have a default value
122
Warning 1265 Data truncated for column 'b' at row 1
82
ERROR HY000: Field 'a' doesn't have a default value
83
insert into t2(a) values(1);
123
84
set sql_warnings=1;
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
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');
128
88
set sql_warnings=0;
129
89
drop table t1, t2;
130
90
create table t1(a char(10));
131
91
alter table t1 add b char;
132
92
set max_error_count=10;
133
93
update t1 set b=a;
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
94
ERROR 22001: Data too long for column 'b' at row 1
95
alter table t1 modify b char(10);
145
97
select @@warning_count;
148
100
set max_error_count=0;
149
101
show variables like 'max_error_count';
150
102
Variable_name Value
151
103
max_error_count 0
152
104
update t1 set b='hi';
154
105
select @@warning_count;
158
109
Level Code Message
159
110
set max_error_count=65535;
168
119
create table t1 (a int);
169
120
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
170
121
update t1 set a='abc';
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
122
ERROR HY000: Incorrect integer value: 'abc' for column 'a' at row 1
182
123
show warnings limit 2, 1;
183
124
Level Code Message
184
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 3
185
125
show warnings limit 0, 10;
186
126
Level Code Message
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
127
Error 1366 Incorrect integer value: 'abc' for column 'a' at row 1
197
128
show warnings limit 9, 1;
198
129
Level Code Message
199
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
200
130
show warnings limit 10, 1;
201
131
Level Code Message
202
132
show warnings limit 9, 2;
203
133
Level Code Message
204
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
205
134
show warnings limit 0, 0;
206
135
Level Code Message
207
136
show warnings limit 1;
208
137
Level Code Message
209
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 1
138
Error 1366 Incorrect integer value: 'abc' for column 'a' at row 1
210
139
show warnings limit 0;
211
140
Level Code Message
212
141
show warnings limit 1, 0;
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);
151
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
278
152
set @c = repeat(' ', 256);
279
153
set @q = repeat('q', 256);
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
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
305
162
insert into t1 values(@q, NULL, NULL);
306
163
ERROR 22001: Data too long for column 'c_char' at row 1
307
164
insert into t1 values(NULL, @q, NULL);
308
165
ERROR 22001: Data too long for column 'c_varchar' at row 1
309
166
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