summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jmiller/ndbdev@ndb08.mysql.com>2007-06-13 05:53:37 +0200
committerunknown <jmiller/ndbdev@ndb08.mysql.com>2007-06-13 05:53:37 +0200
commitc148eb943af66fbf8b017c74fe1d0cc7475fe4e9 (patch)
tree69991264a89000279f72be91895877b9735197cf
parent2cbe88125b7833467f7254f2900ee1c05a418dec (diff)
parentb55468d7139bdbda265c59f5a7643a3814c9d925 (diff)
downloadmariadb-git-c148eb943af66fbf8b017c74fe1d0cc7475fe4e9.tar.gz
Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into mysql.com:/data2/mysql-5.1-maint
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test18
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test10
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test2
-rw-r--r--mysql-test/include/wait_for_slave_io_to_stop.inc33
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_stop.inc30
-rw-r--r--mysql-test/include/wait_for_slave_to_start.inc35
-rw-r--r--mysql-test/include/wait_for_slave_to_stop.inc37
-rw-r--r--mysql-test/t/rpl_critical_errors.test2
-rw-r--r--mysql-test/t/rpl_dual_pos_advance.test2
-rw-r--r--mysql-test/t/rpl_known_bugs_detection.test4
-rw-r--r--mysql-test/t/rpl_rotate_logs.test2
-rw-r--r--mysql-test/t/rpl_row_inexist_tbl.test2
14 files changed, 161 insertions, 26 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index a8a3e33b8cd..abeef5f2903 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -138,7 +138,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -183,7 +183,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -228,7 +228,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -274,7 +274,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -427,7 +427,7 @@ sync_slave_with_master;
#connection slave;
#--echo *** Select from T9 ***
-#wait_for_slave_to_stop;
+#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
#--query_vertical SHOW SLAVE STATUS
@@ -469,7 +469,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -513,7 +513,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -723,7 +723,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
--echo *** Expect slave to fail with Error 1060 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -832,7 +832,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index f4dc655c9b2..acd8fd48234 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -68,7 +68,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
@@ -93,7 +93,7 @@ connection slave;
# The SQL slave thread should be stopped now.
# Exec_Master_Log_Pos should point to the start of Execute event
# for last load data.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
@@ -116,7 +116,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
@@ -152,7 +152,7 @@ load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
drop table t2;
connection master;
drop table t2;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 0cf43d45348..3903c0b0be1 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -113,7 +113,7 @@ sync_slave_with_master;
connection master;
INSERT INTO t1_nodef VALUES (1,2);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -127,7 +127,7 @@ sync_slave_with_master;
connection master;
INSERT INTO t2 VALUES (2,4);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -141,7 +141,7 @@ sync_slave_with_master;
connection master;
INSERT INTO t4 VALUES (4);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -155,7 +155,7 @@ sync_slave_with_master;
connection master;
INSERT INTO t5 VALUES (5,10,25);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
@@ -169,7 +169,7 @@ sync_slave_with_master;
connection master;
INSERT INTO t6 VALUES (6,12,36);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
index 8673ae31305..d007e433ab6 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
@@ -98,7 +98,7 @@ reap;
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
# the master (so it has a non-zero error code in the binlog).
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# The following test can't be done because the result of Pos will differ
# on different computers
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
index 89d57385d7b..3304a0ff46d 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -24,7 +24,7 @@ insert into t1 values(1),(2);
drop table t1;
save_master_pos;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# End of 4.1 tests
diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc
new file mode 100644
index 00000000000..004f8bbbd8d
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_io_to_stop.inc
@@ -0,0 +1,33 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: used for io errors on the slave. If Slave gets an io
+# error, the io trhead should stop
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for
+# sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $my_show= SHOW SLAVE STATUS;
+let $sql_running= Slave_IO_Running;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'No'`){
+ let $run= 0;
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave IO thread to stop"
+ SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc
new file mode 100644
index 00000000000..ee765c81f6a
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc
@@ -0,0 +1,30 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: used for SQL errors on the slave. If Slave gets a sql
+# error, the SQL trhead should stop
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for
+# sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'No'`){
+ let $run= 0;
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave SQL thread to stop"
+ SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
diff --git a/mysql-test/include/wait_for_slave_to_start.inc b/mysql-test/include/wait_for_slave_to_start.inc
new file mode 100644
index 00000000000..84e1d646efe
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_to_start.inc
@@ -0,0 +1,35 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: To wait a brief time for slave to start
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for both
+# io and sql threads to start
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'Yes'`){
+
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'Yes'`){
+ let $run= 0;
+ }
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave to start"
+ SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
+
diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc
new file mode 100644
index 00000000000..13acbecb835
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_to_stop.inc
@@ -0,0 +1,37 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: To replace the mysqltest.c executable
+# wait_for_slave_to_stop function and
+# return this to the test language.
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for both
+# io and sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'No'`){
+
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'No'`){
+ let $run= 0;
+ }
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave to stop"
+ SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
+
diff --git a/mysql-test/t/rpl_critical_errors.test b/mysql-test/t/rpl_critical_errors.test
index ffe00050b01..abf827c8d1f 100644
--- a/mysql-test/t/rpl_critical_errors.test
+++ b/mysql-test/t/rpl_critical_errors.test
@@ -53,7 +53,7 @@ connection slave;
# Here the slave will only stop if the query above actually started
# inserting some rows into t2. Otherwise, it will hang forever.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_to_stop.inc
# The following should be 0
SELECT COUNT(*) FROM t2;
diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
index 074aeec63b1..27c920a3186 100644
--- a/mysql-test/t/rpl_dual_pos_advance.test
+++ b/mysql-test/t/rpl_dual_pos_advance.test
@@ -61,7 +61,7 @@ sync_with_master;
# select master_pos_wait("slave-bin.000001",137);
-# wait_for_slave_to_stop;
+# --source include/wait_for_slave_to_stop.inc
# then BUG#13861 causes t3 to show up below (because stopped too
# late).
diff --git a/mysql-test/t/rpl_known_bugs_detection.test b/mysql-test/t/rpl_known_bugs_detection.test
index ce3debf3c5b..d549c3759a9 100644
--- a/mysql-test/t/rpl_known_bugs_detection.test
+++ b/mysql-test/t/rpl_known_bugs_detection.test
@@ -25,7 +25,7 @@ connection master;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
SELECT * FROM t1;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_to_stop.inc
# show the error message
--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
--query_vertical show slave status;
@@ -79,7 +79,7 @@ ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
SELECT * FROM t1;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_to_stop.inc
# show the error message
--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
--query_vertical show slave status;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 8fe670b3517..155f9f4b6e0 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -96,7 +96,7 @@ connection master;
set insert_id=1234;
insert into t2 values(NULL);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
#restart slave skipping one event
set global sql_slave_skip_counter=1;
diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/t/rpl_row_inexist_tbl.test
index 741cc8b7ba3..803c214b6c5 100644
--- a/mysql-test/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/t/rpl_row_inexist_tbl.test
@@ -23,7 +23,7 @@ insert into t1 values (1);
connection slave;
# slave should have stopped because can't find table t1
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# see if we have a good error message:
--replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 7 # 8 # 9 # 23 # 33 #