1
1
drop table if exists t1, t2;
2
2
create table t1 (a date, b date, c date not null, d date);
3
load data infile '../../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
4
load data infile '../../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
3
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
4
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
7
7
2003-02-03 2003-02-03 2003-02-03 NULL
8
8
2003-03-03 2003-03-03 2003-03-03 NULL
10
load data infile '../../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
10
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
13
13
NULL 2003-02-03 2003-02-03 NULL
14
14
NULL 2003-03-03 2003-03-03 NULL
16
16
create table t1 (a text, b text);
17
load data infile '../../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
17
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
18
18
select concat('|',a,'|'), concat('|',b,'|') from t1;
19
19
concat('|',a,'|') concat('|',b,'|')
20
20
|Field A| |Field B|
36
36
create table t1 (a varchar(20), b varchar(20));
37
load data infile '../../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
37
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
98
98
create table t1 (a int default 100, b int, c varchar(60));
99
load data infile '../../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
99
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
100
100
select * from t1;
104
104
truncate table t1;
105
load data infile '../../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
105
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
106
106
select * from t1;
110
110
truncate table t1;
112
load data infile '../../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
112
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
113
113
select * from t1;
117
load data infile '../../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
117
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
118
118
select * from t1;
127
127
truncate table t1;
128
load data infile '../../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
128
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
129
129
select * from t1;
134
134
truncate table t1;
135
load data infile '../../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
135
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
136
136
select * from t1;
138
138
1 2 1+2+123+2+NIL
139
139
3 4 3+4+123+4+NIL
140
140
5 6 5+6+123+6+NIL
141
load data infile '../../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
141
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
142
142
ERROR HY000: Can't load value from file with fixed size rows to variable
143
143
create table t2 (num int primary key, str varchar(10));
144
144
insert into t2 values (10,'Ten'), (15,'Fifteen');
145
145
truncate table t1;
146
load data infile '../../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
146
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
147
147
select * from t1;