update the test for LOAD DATA INFILE warnings
This commit is contained in:
parent
213847281a
commit
0eb1be584e
@ -30,3 +30,27 @@ create table if not exists t1(id int);
|
||||
select @@warning_count;
|
||||
@@warning_count
|
||||
0
|
||||
drop table t1;
|
||||
create table t1(a tinyint, b int not null, c date, d char(5));
|
||||
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
Warning 1261 Data truncated for column 'd' at row 3
|
||||
Warning 1261 Data truncated for column 'c' at row 4
|
||||
Warning 1259 Value count is fewer than the column count at row 5
|
||||
Warning 1261 Data truncated for column 'b' at row 6
|
||||
Warning 1260 Value count is more than the column count at row 7
|
||||
Warning 1261 Data truncated for column 'a' at row 8
|
||||
select @@warning_count;
|
||||
@@warning_count
|
||||
7
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
Warning 1261 Data truncated for column 'd' at row 3
|
||||
Warning 1261 Data truncated for column 'c' at row 4
|
||||
Warning 1259 Value count is fewer than the column count at row 5
|
||||
Warning 1261 Data truncated for column 'b' at row 6
|
||||
Warning 1260 Value count is more than the column count at row 7
|
||||
Warning 1261 Data truncated for column 'a' at row 8
|
||||
drop table t1;
|
||||
|
8
mysql-test/std_data/warnings_loaddata.dat
Normal file
8
mysql-test/std_data/warnings_loaddata.dat
Normal file
@ -0,0 +1,8 @@
|
||||
10,20,2003-04-21,mysql
|
||||
20,\N,2003-04-22,MySQL
|
||||
30,40,2003-04-23,MySQL is Open Source Database
|
||||
40,50,monty,30
|
||||
50,60,2003-04-24
|
||||
60,67 abc,2003-04-25,mysql
|
||||
70,80,2003-04-26,mysql,open,source
|
||||
500,90,2003-04-27,mysql
|
@ -17,6 +17,7 @@ set SQL_WARNINGS=0;
|
||||
|
||||
#
|
||||
# Test other warnings
|
||||
#
|
||||
|
||||
drop temporary table if exists not_exists;
|
||||
drop table if exists not_exists_table;
|
||||
@ -26,3 +27,14 @@ show count(*) warnings;
|
||||
create table t1(id int);
|
||||
create table if not exists t1(id int);
|
||||
select @@warning_count;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test warnings for LOAD DATA INFILE
|
||||
#
|
||||
|
||||
create table t1(a tinyint, b int not null, c date, d char(5));
|
||||
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
|
||||
select @@warning_count;
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user