2000-12-07 15:54:59 +01:00
|
|
|
source include/master-slave.inc;
|
2000-11-18 07:35:40 +01:00
|
|
|
connection master;
|
|
|
|
use test;
|
2001-04-18 01:53:21 +02:00
|
|
|
drop table if exists t1,t3;
|
2001-01-03 01:15:48 +01:00
|
|
|
create table t1 (word char(20) not null);
|
|
|
|
load data infile '../../std_data/words.dat' into table t1;
|
2001-01-19 20:12:45 +01:00
|
|
|
set password = password('foo');
|
|
|
|
set password = password('');
|
2001-04-18 01:53:21 +02:00
|
|
|
create table t3(n int);
|
|
|
|
insert into t3 values(1),(2);
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
2000-11-18 07:35:40 +01:00
|
|
|
connection slave;
|
2001-01-17 13:47:33 +01:00
|
|
|
sync_with_master;
|
2000-11-18 07:35:40 +01:00
|
|
|
use test;
|
2001-04-18 01:53:21 +02:00
|
|
|
select * from t3;
|
2001-01-17 13:47:33 +01:00
|
|
|
select sum(length(word)) from t1;
|
2001-01-03 01:15:48 +01:00
|
|
|
connection master;
|
2001-04-18 01:53:21 +02:00
|
|
|
drop table t1,t3;
|
2001-01-17 13:47:33 +01:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2001-04-12 00:29:15 +02:00
|
|
|
|
2001-04-11 04:56:54 +02:00
|
|
|
#test handling of aborted connection in the middle of update
|
2001-04-12 00:29:15 +02:00
|
|
|
connection master;
|
|
|
|
reset master;
|
|
|
|
connection slave;
|
|
|
|
reset slave;
|
|
|
|
|
2001-04-11 04:56:54 +02:00
|
|
|
connection master;
|
|
|
|
drop table if exists t1,t2;
|
|
|
|
create table t1(n int);
|
2001-04-12 21:46:19 +02:00
|
|
|
let $1=10;
|
2001-04-11 04:56:54 +02:00
|
|
|
while ($1)
|
|
|
|
{
|
|
|
|
eval insert into t1 values($1);
|
|
|
|
dec $1;
|
|
|
|
}
|
|
|
|
create table t2(id int);
|
|
|
|
insert into t2 values(connection_id());
|
|
|
|
save_master_pos;
|
2001-04-12 21:46:19 +02:00
|
|
|
|
|
|
|
connection master1;
|
|
|
|
#avoid generating result
|
|
|
|
create temporary table t1_temp(n int);
|
|
|
|
insert into t1_temp select get_lock('crash_lock', 1) from t2;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
send update t1 set n = n + get_lock('crash_lock', 2);
|
2001-04-11 04:56:54 +02:00
|
|
|
connection master1;
|
2001-04-12 21:46:19 +02:00
|
|
|
sleep 2;
|
2001-04-11 04:56:54 +02:00
|
|
|
select (@id := id) - id from t2;
|
|
|
|
kill @id;
|
|
|
|
drop table t2;
|
|
|
|
connection master;
|
|
|
|
--error 1053;
|
|
|
|
reap;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master ;
|
2001-04-12 00:29:15 +02:00
|
|
|
#give the slave a chance to exit
|
|
|
|
sleep 0.5;
|
2001-04-18 01:53:21 +02:00
|
|
|
|
|
|
|
# The following test can't be done because the result of Pos will differ
|
2001-04-18 03:23:14 +02:00
|
|
|
# on different computers
|
2001-04-18 01:53:21 +02:00
|
|
|
# --replace_result 9306 9999 3334 9999 3335 9999
|
|
|
|
# show slave status;
|
|
|
|
|
2001-04-11 04:56:54 +02:00
|
|
|
set sql_slave_skip_counter=1;
|
|
|
|
slave start;
|
|
|
|
select count(*) from t1;
|
|
|
|
connection master1;
|
|
|
|
drop table t1;
|
|
|
|
create table t1 (n int);
|
|
|
|
insert into t1 values(3456);
|
2001-05-16 21:19:40 +02:00
|
|
|
use mysql;
|
|
|
|
insert into user (Host, User, Password)
|
|
|
|
VALUES ("10.10.10.%", "blafasel2", "blafasel2");
|
|
|
|
select select_priv,user from mysql.user where user = 'blafasel2';
|
|
|
|
update user set Select_priv = "Y" where User="blafasel2";
|
|
|
|
select select_priv,user from mysql.user where user = 'blafasel2';
|
|
|
|
use test;
|
2001-04-11 04:56:54 +02:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
|
|
|
select n from t1;
|
2001-05-16 21:19:40 +02:00
|
|
|
select select_priv,user from mysql.user where user = 'blafasel2';
|
2001-04-11 04:56:54 +02:00
|
|
|
connection master1;
|
|
|
|
drop table t1;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
|
|
|
|
2000-11-18 07:35:40 +01:00
|
|
|
|