summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2011-01-13 12:21:57 +0000
committerLuis Soares <luis.soares@oracle.com>2011-01-13 12:21:57 +0000
commit8734d5db1eca09353c24675e8048dbf864ba75d7 (patch)
treee55ead1c2ea48cf8f3b53e8d8511eedbab18ba7b /mysql-test/extra
parentac8e0ec1b18e4f16e4db06c2d1b246612df83857 (diff)
downloadmariadb-git-8734d5db1eca09353c24675e8048dbf864ba75d7.tar.gz
BUG#59444
Refactoring effort on test case rpl_show_relaylog_events requested by reviewers.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc17
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc102
3 files changed, 46 insertions, 84 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc
new file mode 100644
index 00000000000..4530f8c639a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc
@@ -0,0 +1,17 @@
+# Include file for rpl_show_relaylog_events.inc
+
+--let $log_type= BINLOG
+if ($is_relay_log) {
+ --let $log_type= RELAYLOG
+}
+--let $args=
+if ($binlog_file != '') {
+ --let $args= IN <FILE>
+}
+if ($binlog_limit) {
+ --let $args= $args LIMIT $binlog_limit
+}
+--echo ******** [$CURRENT_CONNECTION] SHOW $log_type EVENTS $args ********
+--source include/show_events.inc
+
+
diff --git a/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
new file mode 100644
index 00000000000..411f388aaf3
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
@@ -0,0 +1,11 @@
+# Include file for rpl_show_log_events.inc
+
+--let $binlog_limit=
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit= 1
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit= 1,3
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit=
+--let $binlog_file=
+--source extra/rpl_tests/rpl_show_binlog_events.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
index d230b743ae8..b94648479c6 100644
--- a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
+++ b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
@@ -7,103 +7,37 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
--- echo [MASTER] ********* SHOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [MASTER] ********* SHOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SHOW BINLOG EVENTS ... LIMIT rows *********
-let $binlog_limit= 3;
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SHOW BINLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,4;
--- source include/show_binlog_events.inc
-
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_limit= ;
-
--- sync_slave_with_master
-
--- echo [SLAVE] ********* SHOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SHOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SHOW BINLOG EVENTS ... LIMIT rows *********
-let $binlog_limit= 3;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SHOW BINLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,4;
--- source include/show_binlog_events.inc
-
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_limit= ;
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [SLAVE] ********* SHOW RELAYLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
--- source include/show_relaylog_events.inc
-
--- echo [SLAVE] ********* SHOW RELAYLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_relaylog_events.inc
-
--- echo [MASTER] ********* SHOW RELAYLOG EVENTS ... LIMIT rows *********
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-let $binlog_limit= 3;
--- source include/show_relaylog_events.inc
-
--- echo [MASTER] ********* SHOW RELAYLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,3;
--- source include/show_relaylog_events.inc
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
FLUSH LOGS;
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- connection master
FLUSH LOGS;
DROP TABLE t1;
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_file= ;
-let $binlog_limit= ;
-
--- echo [MASTER] ********* SHOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SHOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- sync_slave_with_master
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [SLAVE] ********* SHOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [SLAVE] ********* SHOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SHOW RELAYLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
--- source include/show_relaylog_events.inc
-
--- echo [SLAVE] ********* SHOW RELAYLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_relaylog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_file= ;