2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
drop database if exists mysqltest1;
8
create database mysqltest1;
10
create table t1 (a int);
11
insert into t1 values(9);
12
select * from mysqltest1.t1;
15
show databases like 'mysqltest1';
18
select * from test.t1;
22
drop database mysqltest1;
23
drop database if exists rewrite;
24
create database rewrite;
26
create table t1 (a date, b date, c date not null, d date);
27
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
29
Warning 1265 Data truncated for column 'a' at row 1
30
Warning 1265 Data truncated for column 'c' at row 1
31
Warning 1265 Data truncated for column 'd' at row 1
32
Warning 1265 Data truncated for column 'a' at row 2
33
Warning 1265 Data truncated for column 'b' at row 2
34
Warning 1265 Data truncated for column 'd' at row 2
35
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
36
select * from rewrite.t1;
38
0000-00-00 NULL 0000-00-00 0000-00-00
39
0000-00-00 0000-00-00 0000-00-00 0000-00-00
40
2003-03-03 2003-03-03 2003-03-03 NULL
41
2003-03-03 2003-03-03 2003-03-03 NULL
43
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
45
Warning 1265 Data truncated for column 'c' at row 1
46
Warning 1265 Data truncated for column 'd' at row 1
47
Warning 1265 Data truncated for column 'b' at row 2
48
Warning 1265 Data truncated for column 'd' at row 2
49
select * from rewrite.t1;
51
NULL NULL 0000-00-00 0000-00-00
52
NULL 0000-00-00 0000-00-00 0000-00-00
53
NULL 2003-03-03 2003-03-03 NULL
55
create table t1 (a text, b text);
56
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
58
Warning 1261 Row 3 doesn't contain data for all columns
59
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
60
concat('|',a,'|') concat('|',b,'|')
64
|Field 5' ,'Field 6| NULL
65
|Field 6| | 'Field 7'|
67
create table t1 (a int, b char(10));
68
load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
70
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
71
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
72
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5
73
Warning 1262 Row 5 was truncated; it contained more data than there were input columns
74
select * from rewrite.t1;
82
load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
84
Warning 1366 Incorrect integer value: '
85
' for column 'a' at row 4
86
Warning 1261 Row 4 doesn't contain data for all columns
87
select * from rewrite.t1;
93
drop database rewrite;