mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
366fd92e8d
More messages. Testcase for bug 651. client/mysqltest.c: More explicit error message if MASTER_POS_WAIT() returns NULL. mysql-test/r/rpl_loaddata.result: result update mysql-test/r/rpl_master_pos_wait.result: result update mysql-test/t/rpl000001.test: sync_with_master (=MASTER_POS_WAIT()) was called when we could expect the SQL slave thread had stopped. As I yesterday changed code so that "SQL thread stops => MASTER_POS_WAIT() returns NULL immediately" (bugfix), sync_with_master received NULL (on build.mysql.com, not on my machine; this is a question of milliseconds, if the slave server will process MASTER_POS_WAIT() before or after the slave SQL thread has stopped), and in mysqltest.c, sync_with_master complained that it could not sync. So I just remove this sync_with_master, which does not make sense anymore: we just wait for the slave SQL thread to stop. mysql-test/t/rpl_loaddata.test: Discovered we had wait_for_slave_to_stop, so used it as it automates things. mysql-test/t/rpl_master_pos_wait.test: Discovered we had 'send' to send a query without waiting for the resultn so could had a testcase for bug 651. Shorter timeouts as there is no risk the position is reached. sql/slave.cc: A longer DBUG_PRINT.
46 lines
1.4 KiB
Text
46 lines
1.4 KiB
Text
# See if replication of a "LOAD DATA in an autoincrement column"
|
|
# Honours autoincrement values
|
|
# i.e. if the master and slave have the same sequence
|
|
#
|
|
# check replication of load data for temporary tables with additional parameters
|
|
#
|
|
# check if duplicate entries trigger an error (they should unless IGNORE or
|
|
# REPLACE was used on the master) (bug 571).
|
|
|
|
source include/master-slave.inc;
|
|
|
|
create table t1(a int not null auto_increment, b int, primary key(a) );
|
|
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
|
|
|
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
|
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
|
|
|
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
|
insert into t3 select * from t2;
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
select * from t1;
|
|
select * from t3;
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
drop table t2;
|
|
drop table t3;
|
|
create table t1(a int, b int, unique(b));
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
insert into t1 values(1,10);
|
|
|
|
connection master;
|
|
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
# The SQL slave thread should be stopped now.
|
|
wait_for_slave_to_stop;
|