9
9
create table t1 (a int);
10
--error ER_TABLE_EXISTS_ERROR
11
11
create table t1 (a int);
12
12
show count(*) errors;
15
--error ER_PARSE_ERROR
16
16
create table t (i);
17
17
show count(*) errors;
19
19
insert into t1 values (1);
20
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
21
21
insert into t1 values ("hej");
22
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
23
23
insert into t1 values ("hej"),("d�");
24
24
set SQL_WARNINGS=1;
25
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
26
26
insert into t1 values ("hej");
27
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
28
28
insert into t1 values ("hej"),("d�");
30
30
set SQL_WARNINGS=0;
52
52
create table t1(a int, b int not null, c date, d char(5));
53
--error ER_WARN_NULL_TO_NOTNULL
54
54
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
55
55
# PS doesn't work good with @@warning_count
56
56
--disable_ps_protocol
65
65
create table t1(a int NOT NULL, b int, c char(5));
67
67
# Error data to big for character field
68
--error ER_DATA_TOO_LONG
69
69
insert into t1 values(-1,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
70
70
insert into t1 values(-1,100,'mysql'),(10,-1,'dri '),(500,256,'zzle'),(20,NULL,'test');
72
72
# Error as changing width truncates data
73
--error ER_WARN_DATA_TRUNCATED
74
74
alter table t1 modify c char(4);
75
75
alter table t1 add d char(2);
77
77
# Error trying to insert NULL data into NOT NULL field
78
--error ER_BAD_NULL_ERROR
79
79
update t1 set a=NULL where a=10;
81
81
# Error data to big for character field
82
--error ER_DATA_TOO_LONG
83
83
update t1 set c='drizzle' where c='test';
85
85
# Error data to big for character field
86
--error ER_DATA_TOO_LONG
89
89
create table t2(a int NOT NULL, b char(3));
91
91
# Error data to big for character field
92
--error ER_DATA_TOO_LONG
93
93
insert into t2 select b,c from t1;
95
95
# Error 'a' doesn't have a default value
96
--error ER_NO_DEFAULT_FOR_FIELD
97
97
insert into t2(b) values('mysqlab');
98
98
insert into t2(a) values(1);
100
100
set sql_warnings=1;
102
102
# Error data to big for character field
103
--error ER_DATA_TOO_LONG
104
104
insert into t2(a,b) values(1,'mysqlab');
105
105
insert into t2(a,b) values(1,'mys');
156
156
create table t1 (a int);
157
157
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
158
158
# Incorrect integer value abc for column a
159
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
160
160
update t1 set a='abc';
161
161
show warnings limit 2, 1;
162
162
show warnings limit 0, 10;
180
180
set @q = repeat('q', 256);
182
182
# BUG, 309791 currently only gives a warning but should give error
183
--error ER_DATA_TOO_LONG
183
184
insert into t1 values(@c, @c, @c);
186
--error ER_DATA_TOO_LONG
186
187
insert into t1 values(@q, NULL, NULL);
188
--error ER_DATA_TOO_LONG
188
189
insert into t1 values(NULL, @q, NULL);
189
190
insert into t1 values(NULL, NULL, @q);