1
drop table if exists t1, t2;
3
create table t1 (a int);
4
create table t1 (a int);
5
ERROR 42S01: Table 't1' already exists
11
Error 1050 Table 't1' already exists
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'
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
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
31
insert into t1 values (1);
32
insert into t1 values ("hej");
34
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
35
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
40
insert into t1 values ("hej");
42
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
43
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
49
drop temporary table if exists not_exists;
51
Note 1051 Unknown table 'not_exists'
52
drop table if exists not_exists_table;
54
Note 1051 Unknown table 'not_exists_table'
55
show warnings limit 1;
57
Note 1051 Unknown table 'not_exists_table'
58
drop database if exists not_exists_db;
60
Note 1008 Can't drop database 'not_exists_db'; database doesn't exist
61
show count(*) warnings;
62
@@session.warning_count
64
create table t1(id int);
65
create table if not exists t1(id int);
67
Note 1050 Table 't1' already exists
68
select @@warning_count;
72
create table t1(a tinyint, b int not null, c date, d char(5));
73
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
82
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
95
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
99
alter table t1 add d char(2);
100
update t1 set a=NULL where a=10;
101
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
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));
112
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
119
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
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
130
create table t1(a char(10));
131
alter table t1 add b char;
132
set max_error_count=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
145
select @@warning_count;
148
set max_error_count=0;
149
show variables like 'max_error_count';
152
update t1 set b='hi';
154
select @@warning_count;
159
set max_error_count=65535;
160
show variables like 'max_error_count';
162
max_error_count 65535
163
set max_error_count=10;
164
show variables like 'max_error_count';
168
create table t1 (a int);
169
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
170
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
182
show warnings limit 2, 1;
184
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 3
185
show warnings limit 0, 10;
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
197
show warnings limit 9, 1;
199
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
200
show warnings limit 10, 1;
202
show warnings limit 9, 2;
204
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 10
205
show warnings limit 0, 0;
207
show warnings limit 1;
209
Warning 1366 Incorrect integer value: 'abc' for column 'a' at row 1
210
show warnings limit 0;
212
show warnings limit 1, 0;
214
select * from t1 limit 0;
216
select * from t1 limit 1, 0;
218
select * from t1 limit 0, 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);
278
set @c = repeat(' ', 256);
279
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
305
insert into t1 values(@q, NULL, NULL);
306
ERROR 22001: Data too long for column 'c_char' at row 1
307
insert into t1 values(NULL, @q, NULL);
308
ERROR 22001: Data too long for column 'c_varchar' at row 1
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