summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-06 21:32:29 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-06 21:32:29 +0200
commit72ba95873a6d99def07a4bfecda44fb942165142 (patch)
tree4bcb11afc568c4894f4cb109d57c14968320a58b /mysql-test/include
parentfab9a55d077b4f2a511b273d5f51272f1e3dc1ff (diff)
parent4749d40c635634e25e07d28ce1a04e9263bcc375 (diff)
downloadmariadb-git-72ba95873a6d99def07a4bfecda44fb942165142.tar.gz
10.0-base merge
(without InnoDB - all InnoDB changes were ignored)
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/get_relay_log_pos.inc2
-rw-r--r--mysql-test/include/kill_binlog_dump_threads.inc62
-rw-r--r--mysql-test/include/rpl_init.inc3
-rw-r--r--mysql-test/include/wait_show_condition.inc1
4 files changed, 64 insertions, 4 deletions
diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc
index 61ee07fc655..47a74c9bd41 100644
--- a/mysql-test/include/get_relay_log_pos.inc
+++ b/mysql-test/include/get_relay_log_pos.inc
@@ -40,7 +40,6 @@ CREATE TEMPORARY TABLE mysqlbinlog_events(c1 INT AUTO_INCREMENT KEY, c2 varchar(
# '# .... end_log_pos 46'
eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events
LINES STARTING BY '#' (c2) SET c1 = NULL;
---enable_warnings
# Event pos in relay log file is inserted into table events_at
CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
@@ -49,6 +48,7 @@ CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
# Event pos in master log file is inserted into table events_pos
CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1;
+--enable_warnings
# events_at events_pos
# c1------c2-------------------------- c1------c2------------------------
diff --git a/mysql-test/include/kill_binlog_dump_threads.inc b/mysql-test/include/kill_binlog_dump_threads.inc
new file mode 100644
index 00000000000..38e3e2a7c98
--- /dev/null
+++ b/mysql-test/include/kill_binlog_dump_threads.inc
@@ -0,0 +1,62 @@
+# ==== Purpose ====
+#
+# Terminate all binlog dump threads on a master.
+#
+# This is sometimes useful, as normally such dump threads can hang
+# around for some time before they notice that the slave has disconnected.
+#
+# Note that if there are active slave connections, they might try to
+# reconnect as their dump threads are killed, which may not lead to the
+# desired results.
+#
+#
+# ==== Usage ====
+#
+# [--let $kill_timeout= NUMBER]
+# --source include/stop_slavekill_binlog_dump_threads.inc
+#
+# Parameters:
+# $kill_timeout
+# Maximum number of seconds to wait for dump threads to disappear.
+
+
+--let $include_filename= kill_binlog_dump_threads.inc
+--source include/begin_include_file.inc
+
+--disable_query_log
+
+let $wait_counter= 300;
+if ($kill_timeout)
+{
+ let $wait_counter= `SELECT $kill_timeout * 10`;
+}
+
+let $success= 0;
+while ($wait_counter)
+{
+ dec $wait_counter;
+ let $_tid= `SELECT id FROM information_schema.processlist WHERE command = 'Binlog Dump' LIMIT 1`;
+ if ($_tid)
+ {
+ eval KILL QUERY $_tid;
+ }
+ if (!$_tid)
+ {
+ let $wait_counter= 0;
+ let $success= 1;
+ }
+ if (!$success)
+ {
+ real_sleep 0.1;
+ }
+}
+if (!$success)
+{
+ SHOW FULL PROCESSLIST;
+ --die Timeout while waiting for binlog dump threads to disappear.
+}
+
+--enable_query_log
+
+--let $include_filename= kill_binlog_dump_threads.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index dbe93adbec3..09569fc2b57 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -7,7 +7,6 @@
# well as extra connections server_1_1, server_2_1, ...,
# server_N_1. server_I and server_I_1 are connections to the same
# server.
-# - Sets up @@auto_increment_increment and @@auto_increment_increment.
# - Verifies that @@server_id of all servers are different.
# - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE.
# - Sets the connection to server_1 before exiting.
@@ -180,8 +179,6 @@ while ($_rpl_server)
SET GLOBAL gtid_slave_pos= "";
RESET SLAVE;
}
- eval SET auto_increment_increment= $rpl_server_count;
- eval SET auto_increment_offset= $_rpl_server;
--dec $_rpl_server
}
diff --git a/mysql-test/include/wait_show_condition.inc b/mysql-test/include/wait_show_condition.inc
index ae1600a7e30..b8dd9bdf971 100644
--- a/mysql-test/include/wait_show_condition.inc
+++ b/mysql-test/include/wait_show_condition.inc
@@ -127,5 +127,6 @@ if (!$found)
echo # field : $field;
echo # condition : $condition;
echo # max_run_time : $max_run_time;
+ eval $show_statement;
}