5
drop table if exists t1, t2;
9
create table t1 (a int);
11
create table t1 (a int);
19
insert into t1 values (1);
21
insert into t1 values ("hej");
23
insert into t1 values ("hej"),("d�");
26
insert into t1 values ("hej");
28
insert into t1 values ("hej"),("d�");
36
drop temporary table if exists not_exists;
37
drop table if exists not_exists_table;
38
show warnings limit 1;
39
drop database if exists not_exists_db;
40
show count(*) warnings;
41
create table t1(id int);
42
create table if not exists t1(id int);
44
select @@warning_count;
49
# Test error for LOAD DATA INFILE
52
create table t1(a int, b int not null, c date, d char(5));
54
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
55
# PS doesn't work good with @@warning_count
57
select @@warning_count;
62
# Errors and Warnings from basic INSERT, UPDATE and ALTER commands
65
create table t1(a int NOT NULL, b int, c char(5));
67
# Error data to big for character field
69
insert into t1 values(-1,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
70
insert into t1 values(-1,100,'mysql'),(10,-1,'dri '),(500,256,'zzle'),(20,NULL,'test');
72
# Error as changing width truncates data
74
alter table t1 modify c char(4);
75
alter table t1 add d char(2);
77
# Error trying to insert NULL data into NOT NULL field
79
update t1 set a=NULL where a=10;
81
# Error data to big for character field
83
update t1 set c='drizzle' where c='test';
85
# Error data to big for character field
89
create table t2(a int NOT NULL, b char(3));
91
# Error data to big for character field
93
insert into t2 select b,c from t1;
95
# Error 'a' doesn't have a default value
97
insert into t2(b) values('mysqlab');
98
insert into t2(a) values(1);
102
# Error data to big for character field
104
insert into t2(a,b) values(1,'mysqlab');
105
insert into t2(a,b) values(1,'mys');
111
# Test for max_error_count
114
create table t1(a char(10));
120
eval insert into t1 values('drizzle ab');
125
alter table t1 add b char;
126
set max_error_count=10;
128
# Error data to big for character field
132
alter table t1 modify b char(10);
134
--disable_ps_protocol
135
select @@warning_count;
139
set max_error_count=0;
140
show variables like 'max_error_count';
141
update t1 set b='hi';
142
--disable_ps_protocol
143
select @@warning_count;
146
set max_error_count=65535;
147
show variables like 'max_error_count';
148
set max_error_count=10;
149
show variables like 'max_error_count';
154
# Tests for show errors and warnings limit a, b
156
create table t1 (a int);
157
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
158
# Incorrect integer value abc for column a
160
update t1 set a='abc';
161
show warnings limit 2, 1;
162
show warnings limit 0, 10;
163
show warnings limit 9, 1;
164
show warnings limit 10, 1;
165
show warnings limit 9, 2;
166
show warnings limit 0, 0;
167
show warnings limit 1;
168
show warnings limit 0;
169
show warnings limit 1, 0;
170
# make sure behaviour is consistent with select ... limit
171
select * from t1 limit 0;
172
select * from t1 limit 1, 0;
173
select * from t1 limit 0, 0;
176
--echo End of 4.1 tests
178
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
179
set @c = repeat(' ', 256);
180
set @q = repeat('q', 256);
182
# BUG, 309791 currently only gives a warning but should give error
183
insert into t1 values(@c, @c, @c);
186
insert into t1 values(@q, NULL, NULL);
188
insert into t1 values(NULL, @q, NULL);
189
insert into t1 values(NULL, NULL, @q);
193
--echo End of Drizzle tests