Commit 1cb0eae2 authored by hezx@mail.hezx.com's avatar hezx@mail.hezx.com

fix test failure

parent ede9a262
...@@ -355,7 +355,6 @@ drop table t1, t2; ...@@ -355,7 +355,6 @@ drop table t1, t2;
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
# action # action
...@@ -368,9 +367,7 @@ rollback; ...@@ -368,9 +367,7 @@ rollback;
# check # check
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
show master status; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
show binlog events from 106;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
select * from ti /* that is what slave would miss - a bug */; select * from ti /* that is what slave would miss - a bug */;
...@@ -380,7 +377,6 @@ select * from ti /* that is what slave would miss - a bug */; ...@@ -380,7 +377,6 @@ select * from ti /* that is what slave would miss - a bug */;
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
# action # action
...@@ -393,9 +389,7 @@ rollback; ...@@ -393,9 +389,7 @@ rollback;
# check # check
show master status; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
show binlog events from 106;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
select * from tt /* that is what otherwise slave missed - the bug */; select * from tt /* that is what otherwise slave missed - the bug */;
...@@ -439,14 +433,14 @@ reset master; ...@@ -439,14 +433,14 @@ reset master;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
insert into t2 values (bug27417(2)); insert into t2 values (bug27417(2));
show master status; /* only (!) with fixes for #23333 will show there is the query */; source include/show_binlog_events.inc; /* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */; select count(*) from t1 /* must be 3 */;
reset master; reset master;
select count(*) from t2; select count(*) from t2;
delete from t2 where a=bug27417(3); delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */; select count(*) from t2 /* nothing got deleted */;
show master status; /* the query must be in regardless of #23333 */; source include/show_binlog_events.inc; /* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */; select count(*) from t1 /* must be 5 */;
--enable_info --enable_info
...@@ -488,7 +482,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -488,7 +482,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
# #
...@@ -508,7 +502,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -508,7 +502,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
# #
...@@ -525,7 +519,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -525,7 +519,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
update t3 set b=b+bug27417(1); update t3 set b=b+bug27417(1);
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
## multi_update::send_eof() branch ## multi_update::send_eof() branch
...@@ -543,7 +537,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -543,7 +537,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 4 */; select count(*) from t1 /* must be 4 */;
## send_error() branch of multi_update ## send_error() branch of multi_update
...@@ -586,7 +580,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -586,7 +580,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
delete from t2; delete from t2;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
# cleanup # cleanup
...@@ -607,7 +601,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -607,7 +601,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
delete t2.* from t2,t5 where t2.a=t5.a + 1; delete t2.* from t2,t5 where t2.a=t5.a + 1;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
...@@ -627,7 +621,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -627,7 +621,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
select * from t4; select * from t4;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
# #
# bug#23333 cleanup # bug#23333 cleanup
......
...@@ -392,9 +392,6 @@ drop table t1, t2; ...@@ -392,9 +392,6 @@ drop table t1, t2;
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) ; insert into ti values (2) ;
...@@ -405,16 +402,13 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back ...@@ -405,16 +402,13 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
count(*) count(*)
2 2
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 515 master-bin.000001 # Query # # use `test`; BEGIN
show binlog events from 106; master-bin.000001 # Query # # use `test`; insert into ti values (1)
Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; insert into ti values (2)
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query # # use `test`; insert into tt select * from ti
master-bin.000001 # Query 1 # use `test`; insert into ti values (1) master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query 1 # use `test`; insert into ti values (2)
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti
master-bin.000001 # Query 1 # use `test`; ROLLBACK
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
count(*) count(*)
0 0
...@@ -426,9 +420,6 @@ a ...@@ -426,9 +420,6 @@ a
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */; insert into ti values (2) /* to make the dup error in the following */;
...@@ -437,16 +428,13 @@ ERROR 23000: Duplicate entry '2' for key 'a' ...@@ -437,16 +428,13 @@ ERROR 23000: Duplicate entry '2' for key 'a'
rollback; rollback;
Warnings: Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back Warning 1196 Some non-transactional changed tables couldn't be rolled back
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 589 master-bin.000001 # Query # # use `test`; BEGIN
show binlog events from 106; master-bin.000001 # Query # # use `test`; insert into ti values (1)
Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; insert into ti values (2) /* to make the dup error in the following */
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query # # use `test`; insert into tt select * from ti /* one affected and error */
master-bin.000001 # Query 1 # use `test`; insert into ti values (1) master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query 1 # use `test`; insert into ti values (2) /* to make the dup error in the following */
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti /* one affected and error */
master-bin.000001 # Query 1 # use `test`; ROLLBACK
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
count(*) count(*)
0 0
...@@ -472,9 +460,11 @@ insert into t2 select bug27417(2); ...@@ -472,9 +460,11 @@ insert into t2 select bug27417(2);
reset master; reset master;
insert into t2 values (bug27417(2)); insert into t2 values (bug27417(2));
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 222 master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
/* only (!) with fixes for #23333 will show there is the query */; /* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */; select count(*) from t1 /* must be 3 */;
count(*) count(*)
...@@ -487,9 +477,11 @@ delete from t2 where a=bug27417(3); ...@@ -487,9 +477,11 @@ delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */; select count(*) from t2 /* nothing got deleted */;
count(*) count(*)
2 2
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 227 master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
/* the query must be in regardless of #23333 */; /* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */; select count(*) from t1 /* must be 5 */;
count(*) count(*)
...@@ -509,9 +501,13 @@ insert into t2 values (1); ...@@ -509,9 +501,13 @@ insert into t2 values (1);
reset master; reset master;
insert into t2 values (bug27417(1)); insert into t2 values (bug27417(1));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 371 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
count(*) count(*)
1 1
...@@ -521,9 +517,13 @@ insert into t2 values (2); ...@@ -521,9 +517,13 @@ insert into t2 values (2);
reset master; reset master;
insert into t2 select bug27417(1) union select bug27417(2); insert into t2 select bug27417(1) union select bug27417(2);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 394 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=2
master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2)
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
count(*) count(*)
2 2
...@@ -532,9 +532,11 @@ insert into t3 values (1,1),(2,3),(3,4); ...@@ -532,9 +532,11 @@ insert into t3 values (1,1),(2,3),(3,4);
reset master; reset master;
update t3 set b=b+bug27417(1); update t3 set b=b+bug27417(1);
ERROR 23000: Duplicate entry '4' for key 'b' ERROR 23000: Duplicate entry '4' for key 'b'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 226 master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
count(*) count(*)
2 2
...@@ -545,9 +547,13 @@ insert into t4 values (1,1),(2,2); ...@@ -545,9 +547,13 @@ insert into t4 values (1,1),(2,2);
reset master; reset master;
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 405 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=6
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 4 */; select count(*) from t1 /* must be 4 */;
count(*) count(*)
4 4
...@@ -573,9 +579,13 @@ insert into t3 values (bug27417(1), 2); ...@@ -573,9 +579,13 @@ insert into t3 values (bug27417(1), 2);
reset master; reset master;
delete from t2; delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 350 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=9
master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
count(*) count(*)
1 1
...@@ -590,9 +600,12 @@ insert into t5 values (1),(2); ...@@ -590,9 +600,12 @@ insert into t5 values (1),(2);
reset master; reset master;
delete t2.* from t2,t5 where t2.a=t5.a + 1; delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 350 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
count(*) count(*)
1 1
...@@ -608,9 +621,15 @@ a b ...@@ -608,9 +621,15 @@ a b
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
count(*) count(*)
2 2
show master status /* the offset must denote there is the query */; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 508 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2; drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5; drop table t1,t2,t3,t4,t5;
drop function bug27417; drop function bug27417;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment