mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
4a7af05c7f
BitKeeper/deleted/.del-compile-ia64-O0-sgicc~a4e0732013d6b602: Delete: BUILD/compile-ia64-O0-sgicc BitKeeper/deleted/.del-compile-ia64-O0~3a41dfebefc817d1: Delete: BUILD/compile-ia64-O0 BitKeeper/deleted/.del-compile-ia64-O2-sgicc~6ff796ecac337849: Delete: BUILD/compile-ia64-O2-sgicc BitKeeper/deleted/.del-compile-ia64-O2~87d13594c3599830: Delete: BUILD/compile-ia64-O2 BitKeeper/deleted/.del-compile-ia64-O6~c34e6b943b12c468: Delete: BUILD/compile-ia64-O6 Docs/manual.texi: Cleanup mysql-test/r/rpl000014.result: Change port number for comparison mysql-test/r/rpl000015.result: Change port number for comparison mysql-test/r/rpl000016.result: Change port number for comparison mysql-test/t/rpl000014.test: Change port number for comparison mysql-test/t/rpl000015.test: Change port number for comparison mysql-test/t/rpl000016.test: Change port number for comparison sql-bench/Results/ATIS-mysql-NT_4.0: New test results sql-bench/Results/RUN-mysql-NT_4.0: New test results sql-bench/Results/alter-table-mysql-NT_4.0: New test results sql-bench/Results/big-tables-mysql-NT_4.0: New test results sql-bench/Results/connect-mysql-NT_4.0: New test results sql-bench/Results/create-mysql-NT_4.0: New test results sql-bench/Results/insert-mysql-NT_4.0: New test results sql-bench/Results/select-mysql-NT_4.0: New test results sql-bench/Results/wisconsin-mysql-NT_4.0: New test results sql/slave.cc: Removed not used variable
103 lines
2.4 KiB
Text
103 lines
2.4 KiB
Text
connect (master,localhost,root,,test,0,mysql-master.sock);
|
|
connect (slave,localhost,root,,test,0,mysql-slave.sock);
|
|
system cat /dev/null > var/slave-data/master.info;
|
|
system chmod 000 var/slave-data/master.info;
|
|
connection slave;
|
|
!slave start;
|
|
system chmod 600 var/slave-data/master.info;
|
|
!slave start;
|
|
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
|
|
master_user='root';
|
|
reset slave;
|
|
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
|
|
master_user='root';
|
|
connection master;
|
|
reset master;
|
|
connection slave;
|
|
slave start;
|
|
connection master;
|
|
drop table if exists t1;
|
|
create table t1 (s text);
|
|
insert into t1 values('Could not break slave'),('Tried hard');
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
--replace_result 9306 9999 3334 9999 3335 9999
|
|
show slave status;
|
|
select * from t1;
|
|
connection master;
|
|
flush logs;
|
|
drop table if exists t2;
|
|
create table t2(m int not null primary key);
|
|
insert into t2 values (34),(67),(123);
|
|
save_master_pos;
|
|
flush logs;
|
|
show master logs;
|
|
|
|
#now lets make some duplicate key mess and see if we can recover from it
|
|
|
|
#first insert a value on the slave
|
|
connection slave;
|
|
sync_with_master;
|
|
insert into t2 values(1234);
|
|
|
|
#same value on the master
|
|
connection master;
|
|
save_master_pos;
|
|
insert into t2 values(1234);
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
#the slave may have already stopped, so we ignore the error
|
|
!slave stop;
|
|
|
|
#restart slave skipping one event
|
|
set sql_slave_skip_counter=1;
|
|
slave start;
|
|
|
|
connection master;
|
|
save_master_pos;
|
|
|
|
#let slave catch up
|
|
connection slave;
|
|
sync_with_master;
|
|
connection master;
|
|
purge master logs to 'master-bin.003';
|
|
show master logs;
|
|
insert into t2 values (65);
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
--replace_result 9306 9999 3334 9999 3335 9999
|
|
show slave status;
|
|
select * from t2;
|
|
connection master;
|
|
let $1=100;
|
|
drop table if exists t3;
|
|
create table t3 (n int);
|
|
while ($1)
|
|
{
|
|
#eval means expand $ expressions
|
|
eval insert into t3 values($1 + 4);
|
|
dec $1;
|
|
}
|
|
show master logs;
|
|
show master status;
|
|
save_master_pos;
|
|
connection slave;
|
|
slave stop;
|
|
slave start;
|
|
sync_with_master;
|
|
--replace_result 9306 9999 3334 9999 3335 9999
|
|
show slave status;
|
|
# because of concurrent insert, the table may not be up to date
|
|
# if we do not lock
|
|
lock tables t3 read;
|
|
select count(*) from t3 where n >= 4;
|
|
unlock tables;
|
|
#clean up
|
|
connection master;
|
|
drop table if exists t1,t2,t3;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|