#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-sea
2697 Serge Kozlov 2008-09-15
Bug#37716. Remove real_sleep and and waiting proper values of Read_Master_Log_Pos and
Exec_Master_Log_Pos on slave.
modified:
mysql-test/extra/rpl_tests/rpl_deadlock.test
=== modified file 'mysql-test/extra/rpl_tests/rpl_deadlock.test'
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test 2008-02-03 09:00:49 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test 2008-09-15 07:46:42 +0000
@@ -44,6 +44,7 @@ enable_query_log;
insert into t1 values(1);
commit;
save_master_pos;
+let $master_pos= query_get_value(show master status, Position, 1);
connection slave;
begin;
@@ -59,12 +60,15 @@ enable_query_log;
select * from t1 for update; # t1,t2 on local slave's
start slave;
-# bad option, todo: replicate a non-transactional t_sync with the transaction
-# and use wait_until_rows_count macro below
---real_sleep 3 # hope that slave is blocked now
-#let $count=11;
-#let $table=t_sync;
-#--include wait_until_rows_count.inc
+# wait while slave read all events from master
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $master_pos;
+--source include/wait_for_slave_param.inc
+
+# wait while slave executed up to start of transaction
+let $slave_param= Exec_Master_Log_Pos;
+let $slave_param_value= 549;
+--source include/wait_for_slave_param.inc
select * from t2 for update /* dl */; # provoke deadlock, repl-ed should be victim
commit;