Commit 102c1945 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

do not log the drop internal temporary tables into the binary log

mark killed partially completed updates with an error code in binlog
stop replication if the master reports a possible partial/killed update
test partially killed update
parent 54b9d367
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -236,3 +236,11 @@ support-files/mysql.server
support-files/mysql.spec
tags
tmp/*
bdb/btree/btree_auto.c
bdb/build_vxworks/db_int.h
bdb/build_win32/db_int.h
bdb/build_win32/include.tcl
bdb/build_win32/libdb.rc
bdb/db/crdel_auto.c
bdb/db/db_auto.c
bdb/dist/config.hin
+8 −0
Original line number Diff line number Diff line
@@ -3,3 +3,11 @@ n
2
sum(length(word))
71
(@id := id) - id
0
Master_Host	Master_User	Master_Port	Connect_retry	Log_File	Pos	Slave_Running	Replicate_do_db	Replicate_ignore_db	Last_errno	Last_error	Skip_counter
127.0.0.1	root	9306	1	master-bin.001	1729584	No			1053	Slave: query ' update t1 set n = n + 1' partially completed on the master and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START;	0
count(*)
30000
n
3456
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@ n
1
2
3
100
101
4
5
6
+42 −0
Original line number Diff line number Diff line
@@ -20,4 +20,46 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
#test handling of aborted connection in the middle of update
connection master;
drop table if exists t1,t2;
create table t1(n int);
let $1=30000;
while ($1)
{
 eval insert into t1 values($1);
 dec $1;
}
create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
send update t1 set n = n + 1;
connection master1;
select (@id := id) - id from t2;
sleep 0.1;
kill @id;
drop table t2;
connection master;
--error 1053;
reap;
connection slave;
sync_with_master ;
show slave status;
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);
save_master_pos;
connection slave;
sync_with_master;
select n from t1;
connection master1;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

+8 −1
Original line number Diff line number Diff line
source include/master-slave.inc;
connection master;
drop table if exists t1,t2;
drop table if exists t1,t2,t3;

create table t2 (n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
insert into t2 select * from t1;
drop table if exists test.t3;
create temporary table test.t3 (n int not null);
alter table test.t3 add primary key(n);
insert into t3 values (100);
insert into t2 select * from t3;
drop table if exists test.t3;
insert into t2 values (101);
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
Loading