List:Commits« Previous MessageNext Message »
From:Serge Kozlov Date:February 28 2008 11:36am
Subject:bk commit into 5.1 tree (skozlov:1.2545)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of skozlov.  When skozlov does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-28 14:36:14+03:00, skozlov@stripped +9 -0
  WL#4091, replace sleeps

  mysql-test/include/wait_for_binlog_event.inc@stripped, 2008-02-28 14:36:07+03:00, skozlov@stripped +33 -0
    New primitive: waiting an event in binlog on master

  mysql-test/include/wait_for_binlog_event.inc@stripped, 2008-02-28 14:36:07+03:00, skozlov@stripped +0 -0

  mysql-test/suite/rpl/r/rpl_flushlog_loop.result@stripped, 2008-02-28 14:36:05+03:00, skozlov@stripped +3 -3
    updated result

  mysql-test/suite/rpl/r/rpl_row_view01.result@stripped, 2008-02-28 14:36:05+03:00, skozlov@stripped +3 -0
    updated result

  mysql-test/suite/rpl/t/rpl_change_master.test@stripped, 2008-02-28 14:36:05+03:00, skozlov@stripped +3 -1
    replace sleep

  mysql-test/suite/rpl/t/rpl_drop_temp.test@stripped, 2008-02-28 14:36:05+03:00, skozlov@stripped +9 -3
    replace sleep

  mysql-test/suite/rpl/t/rpl_flushlog_loop.test@stripped, 2008-02-28 14:36:06+03:00, skozlov@stripped +22 -3
    replace sleep

  mysql-test/suite/rpl/t/rpl_relayspace.test@stripped, 2008-02-28 14:36:06+03:00, skozlov@stripped +4 -17
    replace waiting of state to wait_for_slave_param.inc

  mysql-test/suite/rpl/t/rpl_row_view01.test@stripped, 2008-02-28 14:36:06+03:00, skozlov@stripped +12 -4
    replace sleep

  mysql-test/suite/rpl/t/rpl_trunc_temp.test@stripped, 2008-02-28 14:36:06+03:00, skozlov@stripped +6 -1
    replace sleep

diff -Nrup a/mysql-test/include/wait_for_binlog_event.inc b/mysql-test/include/wait_for_binlog_event.inc
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/wait_for_binlog_event.inc	2008-02-28 14:36:07 +03:00
@@ -0,0 +1,33 @@
+# include/wait_for_binlog_event.inc
+#
+# SUMMARY
+#
+#    Waits until SHOW BINLOG EVENTS has returned in last event a specified substring.
+#
+# USAGE
+#
+#    let $wait_binlog_event= DROP;
+#    --source include/wait_for_binlog_event.inc
+
+let $_loop_count= 300;
+let $_last_event= ;
+let $_event_pos= 1;
+
+while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`)
+{
+  dec $_loop_count;
+  if (!$_loop_count)
+  {
+    SHOW BINLOG EVENTS;
+    --die ERROR: failed while waiting for $wait_binlog_event in binlog 
+  }
+  real_sleep 0.1;
+  let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
+  let $_last_event= $_event;
+  while (`SELECT "$_event" != "No such row"`)
+  {
+    inc $_event_pos;
+    let $_last_event= $_event;
+    let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
+  }
+}
diff -Nrup a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2007-10-10 11:25:03 +04:00
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2008-02-28 14:36:05 +03:00
@@ -23,7 +23,7 @@ start slave;
 let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
 
 --source include/wait_slave_status.inc
-flush logs;
+FLUSH LOGS;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -31,7 +31,7 @@ Master_User	root
 Master_Port	SLAVE_PORT
 Connect_Retry	60
 Master_Log_File	slave-bin.000001
-Read_Master_Log_Pos	216
+Read_Master_Log_Pos	POSITION
 Relay_Log_File	#
 Relay_Log_Pos	#
 Relay_Master_Log_File	slave-bin.000001
@@ -46,7 +46,7 @@ Replicate_Wild_Ignore_Table	
 Last_Errno	0
 Last_Error	
 Skip_Counter	0
-Exec_Master_Log_Pos	216
+Exec_Master_Log_Pos	POSITION
 Relay_Log_Space	#
 Until_Condition	None
 Until_Log_File	
diff -Nrup a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
--- a/mysql-test/suite/rpl/r/rpl_row_view01.result	2007-06-27 16:27:31 +04:00
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result	2008-02-28 14:36:05 +03:00
@@ -13,6 +13,7 @@ DROP TABLE IF EXISTS mysqltest1.t3;
 DROP TABLE IF EXISTS mysqltest1.t1;
 DROP TABLE IF EXISTS mysqltest1.t2;
 DROP TABLE IF EXISTS mysqltest1.t4;
+DROP TABLE IF EXISTS mysqltest1.t10;
 CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
 CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
 CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
@@ -35,6 +36,7 @@ a	c	c2
 1	Thank	GOD
 2	it	is
 3	Friday	TGIF
+CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a));
 SELECT * FROM mysqltest1.v2;
 qty	price	value
 3	50	150
@@ -98,4 +100,5 @@ DROP TABLE IF EXISTS mysqltest1.t3;
 DROP TABLE IF EXISTS mysqltest1.t1;
 DROP TABLE IF EXISTS mysqltest1.t2;
 DROP TABLE IF EXISTS mysqltest1.t4;
+DROP TABLE IF EXISTS mysqltest1.t10;
 DROP DATABASE mysqltest1;
diff -Nrup a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
--- a/mysql-test/suite/rpl/t/rpl_change_master.test	2008-01-14 10:37:56 +03:00
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test	2008-02-28 14:36:05 +03:00
@@ -15,8 +15,10 @@ connection master;
 insert into t1 values(1);
 insert into t1 values(2);
 save_master_pos;
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
 connection slave;
---real_sleep 3 # wait for I/O thread to have read updates
+source include/wait_for_slave_param.inc;
 stop slave;
 source include/show_slave_status2.inc;
 change master to master_user='root';
diff -Nrup a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
--- a/mysql-test/suite/rpl/t/rpl_drop_temp.test	2007-06-27 16:27:30 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test	2008-02-28 14:36:05 +03:00
@@ -6,19 +6,25 @@
 # to work around NDB's issue with temp tables
 ##############################################
 source include/master-slave.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
 --disable_warnings
 create database if not exists mysqltest;
 --enable_warnings
 
 create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
 create temporary table mysqltest.t2 (n int)ENGINE=MyISAM;
-sync_slave_with_master;
+
 connection master;
 disconnect master;
+
+connection master1;
+# Wait until drop of temp tables appears in binlog
+let $wait_binlog_event= DROP;
+source include/wait_for_binlog_event.inc;
+
 connection slave;
---real_sleep 3 # time for DROP to be written
 show status like 'Slave_open_temp_tables';
-
 # Cleanup
 connection default;
 drop database mysqltest;
diff -Nrup a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2007-10-10 11:37:04 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2008-02-28 14:36:06 +03:00
@@ -35,12 +35,31 @@ let $result_pattern= '%127.0.0.1%root%sl
 #
 #  Flush logs of slave
 #
-flush logs;
-sleep 5;
+# Create full loop by following way:
+# 1. Insert into t1 on master (1st).
+# 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated.
+# 3. Master waits until the event (2nd) for t1 will be replicated.
+
+--disable_query_log
+CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
+INSERT INTO t1 VALUE(1);
+--enable_query_log
+FLUSH LOGS;
+connection slave;
+let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
+-- source include/wait_condition.inc
+--disable_query_log
+INSERT INTO t1 VALUE(2);
+--enable_query_log
+connection master;
+let $wait_condition= SELECT COUNT(*) = 2 FROM t1;
+-- source include/wait_condition.inc
+--enable_query_log
 
 #
 #  Show status of slave
 #
---replace_result $SLAVE_MYPORT SLAVE_PORT
+let $pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+--replace_result $SLAVE_MYPORT SLAVE_PORT $pos POSITION
 --replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
 --query_vertical SHOW SLAVE STATUS
diff -Nrup a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
--- a/mysql-test/suite/rpl/t/rpl_relayspace.test	2007-08-28 04:33:52 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test	2008-02-28 14:36:06 +03:00
@@ -14,23 +14,10 @@ connection slave;
 reset slave;
 start slave io_thread;
 # Give the I/O thread time to block.
-let $run= 1;
-let $counter= 300;
-while ($run)
-{
-  let $io_state= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
-  if (`SELECT '$io_state' = 'Waiting for the slave SQL thread to free enough relay log space'`){
-    let $run= 0;
-  }
-  sleep 0.1;
-  if (!$counter){
-   --echo "Failed while waiting for slave IO thread block"
-   SHOW SLAVE STATUS;
-   exit;
-  }
-  dec $counter;
-}
-sleep 2;
+let $slave_param= Slave_IO_State;
+let $slave_param_value= Waiting for the slave SQL thread to free enough relay log space;
+source include/wait_for_slave_param.inc;
+
 # A bug caused the I/O thread to refuse stopping.
 stop slave io_thread;
 reset slave;
diff -Nrup a/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
--- a/mysql-test/suite/rpl/t/rpl_row_view01.test	2007-06-27 16:27:32 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test	2008-02-28 14:36:06 +03:00
@@ -23,6 +23,7 @@ DROP TABLE IF EXISTS mysqltest1.t3;
 DROP TABLE IF EXISTS mysqltest1.t1;
 DROP TABLE IF EXISTS mysqltest1.t2;
 DROP TABLE IF EXISTS mysqltest1.t4;
+DROP TABLE IF EXISTS mysqltest1.t10;
 
 # Begin test section 1 
 CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
@@ -43,12 +44,18 @@ CREATE VIEW mysqltest1.v4 AS SELECT * FR
 
 SELECT * FROM mysqltest1.v2;
 SELECT * FROM mysqltest1.v1;
-# Had to add a sleep for use with NDB
+
+
+# Had to add a waiting for use with NDB
 # engine. Injector thread would have not 
-# populated biblog and data would not be on 
+# populated binlog and data would not be on 
 # the slave.
-sleep 10;
-sync_slave_with_master;
+
+CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a));
+let $wait_binlog_event= CREATE TABLE mysqltest1.t10;
+-- source include/wait_for_binlog_event.inc
+--sync_slave_with_master
+
 SELECT * FROM mysqltest1.v2;
 SELECT * FROM mysqltest1.v1;
 connection master;
@@ -82,6 +89,7 @@ DROP TABLE IF EXISTS mysqltest1.t3;
 DROP TABLE IF EXISTS mysqltest1.t1;
 DROP TABLE IF EXISTS mysqltest1.t2;
 DROP TABLE IF EXISTS mysqltest1.t4;
+DROP TABLE IF EXISTS mysqltest1.t10;
 DROP DATABASE mysqltest1;
 sync_slave_with_master;
 
diff -Nrup a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
--- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test	2007-06-27 16:27:24 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test	2008-02-28 14:36:06 +03:00
@@ -27,7 +27,12 @@ show status like 'Slave_open_temp_tables
 
 # Disconnect the master, temp table on slave should dissapear
 disconnect master;
---real_sleep 3 # time for DROP to be read by slave
+
+connection master1;
+# Wait until drop of temp tables appers in binlog
+let $wait_binlog_event= DROP;
+source include/wait_for_binlog_event.inc;
+
 connection slave;
 show status like 'Slave_open_temp_tables';
 
Thread
bk commit into 5.1 tree (skozlov:1.2545)Serge Kozlov28 Feb