49
# Test warnings for LOAD DATA INFILE
49
# Test error for LOAD DATA INFILE
52
52
create table t1(a int, b int not null, c date, d char(5));
53
54
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
54
55
# PS doesn't work good with @@warning_count
55
56
--disable_ps_protocol
61
# Warnings from basic INSERT, UPDATE and ALTER commands
62
# Errors and Warnings from basic INSERT, UPDATE and ALTER commands
64
65
create table t1(a int NOT NULL, b int, c char(5));
65
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
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
66
74
alter table t1 modify c char(4);
67
75
alter table t1 add d char(2);
77
# Error trying to insert NULL data into NOT NULL field
69
79
update t1 set a=NULL where a=10;
70
update t1 set c='mysql ab' where c='test';
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
72
89
create table t2(a int NOT NULL, b char(3));
91
# Error data to big for character field
73
93
insert into t2 select b,c from t1;
95
# Error 'a' doesn't have a default value
74
97
insert into t2(b) values('mysqlab');
98
insert into t2(a) values(1);
75
100
set sql_warnings=1;
76
insert into t2(b) values('mysqlab');
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');
77
107
set sql_warnings=0;
78
108
drop table t1, t2;
116
# Tests for show warnings limit a, b
152
# Tests for show errors and warnings limit a, b
118
154
create table t1 (a int);
119
155
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
120
# should generate 10 warnings
156
# Incorrect integer value abc for column a
121
158
update t1 set a='abc';
122
159
show warnings limit 2, 1;
123
160
show warnings limit 0, 10;
137
174
--echo End of 4.1 tests
140
# Bug#20778: strange characters in warning message 1366 when called in SP
143
CREATE TABLE t1( f1 CHAR(20) );
144
CREATE TABLE t2( f1 CHAR(20), f2 CHAR(25) );
145
CREATE TABLE t3( f1 CHAR(20), f2 CHAR(25), f3 DATE );
147
INSERT INTO t1 VALUES ( 'a`' );
148
INSERT INTO t2 VALUES ( 'a`', 'a`' );
149
INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
151
DROP PROCEDURE IF EXISTS sp1;
152
DROP PROCEDURE IF EXISTS sp2;
153
DROP PROCEDURE IF EXISTS sp3;
155
CREATE PROCEDURE sp1()
157
DECLARE x NUMERIC ZEROFILL;
158
SELECT f1 INTO x FROM t1 LIMIT 1;
160
CREATE PROCEDURE sp2()
162
DECLARE x NUMERIC ZEROFILL;
163
SELECT f1 INTO x FROM t2 LIMIT 1;
165
CREATE PROCEDURE sp3()
167
DECLARE x NUMERIC ZEROFILL;
168
SELECT f1 INTO x FROM t3 LIMIT 1;
175
DROP PROCEDURE IF EXISTS sp1;
177
CREATE PROCEDURE sp1()
179
declare x numeric zerofill;
180
SELECT f1 into x from t2 limit 1;
193
# Bug#30059: End-space truncation warnings are inconsistent or incorrect
196
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext tinytext);
197
create table t2 (c_tinyblob tinyblob); # not affected by bug, for regression testing
176
create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext blob);
198
177
set @c = repeat(' ', 256);
199
178
set @q = repeat('q', 256);
203
insert into t1 values(@c, @c, @c);
204
insert into t2 values(@c);
205
insert into t1 values(@q, @q, @q);
206
insert into t2 values(@q);
208
set sql_mode = 'traditional';
210
insert into t1 values(@c, @c, @c);
212
insert into t2 values(@c);
180
# BUG, 309791 currently only gives a warning but should give error
181
insert into t1 values(@c, @c, @c);
214
184
insert into t1 values(@q, NULL, NULL);
216
186
insert into t1 values(NULL, @q, NULL);
218
187
insert into t1 values(NULL, NULL, @q);
220
insert into t2 values(@q);
224
--echo End of 5.0 tests
191
--echo End of Drizzle tests