2004-10-19 22:27:19 +02:00
|
|
|
source include/master-slave.inc;
|
|
|
|
--disable_warnings
|
|
|
|
drop database if exists mysqltest1;
|
|
|
|
--enable_warnings
|
|
|
|
create database mysqltest1;
|
|
|
|
|
|
|
|
use mysqltest1;
|
|
|
|
create table t1 (a int);
|
|
|
|
insert into t1 values(9);
|
|
|
|
select * from mysqltest1.t1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
show databases like 'mysqltest1'; # should be empty
|
|
|
|
select * from test.t1;
|
|
|
|
# cleanup
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
drop database mysqltest1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
|
2004-11-15 17:03:54 +01:00
|
|
|
#
|
|
|
|
# BUG#6353:
|
|
|
|
# Option --replicate-rewrite-db should work together with LOAD DATA INFILE
|
|
|
|
#
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
--disable_warnings
|
|
|
|
drop database if exists rewrite;
|
|
|
|
--enable_warnings
|
|
|
|
create database rewrite;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
use test;
|
|
|
|
create table t1 (a date, b date, c date not null, d date);
|
2006-01-24 08:30:54 +01:00
|
|
|
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
|
|
|
|
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
|
2004-11-15 17:03:54 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
select * from rewrite.t1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
truncate table t1;
|
2006-01-24 08:30:54 +01:00
|
|
|
load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
|
2004-11-15 17:03:54 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
select * from rewrite.t1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
create table t1 (a text, b text);
|
2006-01-24 08:30:54 +01:00
|
|
|
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
|
2004-11-15 17:03:54 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
create table t1 (a int, b char(10));
|
2006-01-24 08:30:54 +01:00
|
|
|
load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
|
2004-11-15 17:03:54 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
select * from rewrite.t1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
truncate table t1;
|
2006-01-24 08:30:54 +01:00
|
|
|
load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
|
2004-11-15 17:03:54 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
|
|
|
|
connection slave;
|
|
|
|
# The empty line last comes from the end line field in the file
|
|
|
|
select * from rewrite.t1;
|
|
|
|
|
2005-04-06 12:20:55 +02:00
|
|
|
drop database rewrite;
|
|
|
|
|
2004-11-15 17:03:54 +01:00
|
|
|
connection master;
|
|
|
|
drop table t1;
|
2005-04-06 12:20:55 +02:00
|
|
|
|
2005-07-28 02:22:47 +02:00
|
|
|
# End of 4.1 tests
|