mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
test cleanup: use --replace_result correctly
* replace binlog positions where they are calculated (instead of --disable_query_log) * don't replace binlog positions when they're hard-coded anyway
This commit is contained in:
@@ -9,7 +9,8 @@ INSERT INTO t2 VALUES (3),(4);
|
|||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
RESET SLAVE;
|
RESET SLAVE;
|
||||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1
|
CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT;
|
||||||
|
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
n
|
n
|
||||||
@@ -18,7 +19,7 @@ n
|
|||||||
3
|
3
|
||||||
4
|
4
|
||||||
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
||||||
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
|
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
n
|
n
|
||||||
@@ -30,7 +31,7 @@ include/check_slave_param.inc [Exec_Master_Log_Pos]
|
|||||||
START SLAVE;
|
START SLAVE;
|
||||||
include/wait_for_slave_to_start.inc
|
include/wait_for_slave_to_start.inc
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
|
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
|
||||||
include/wait_for_slave_param.inc [Until_Log_Pos]
|
include/wait_for_slave_param.inc [Until_Log_Pos]
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
||||||
@@ -55,6 +56,7 @@ include/stop_slave_sql.inc
|
|||||||
INSERT INTO t1 VALUES (2);
|
INSERT INTO t1 VALUES (2);
|
||||||
INSERT INTO t1 VALUES (3);
|
INSERT INTO t1 VALUES (3);
|
||||||
include/sync_slave_io_with_master.inc
|
include/sync_slave_io_with_master.inc
|
||||||
|
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=relay_log_pos;
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
include/assert.inc [table t1 should have two rows.]
|
include/assert.inc [table t1 should have two rows.]
|
||||||
include/start_slave.inc
|
include/start_slave.inc
|
||||||
|
@@ -25,7 +25,7 @@ n
|
|||||||
3
|
3
|
||||||
4
|
4
|
||||||
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
||||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
|
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||||
include/wait_for_slave_io_to_start.inc
|
include/wait_for_slave_io_to_start.inc
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
select * from t1;
|
select * from t1;
|
||||||
@@ -52,18 +52,18 @@ include/wait_for_slave_io_to_start.inc
|
|||||||
include/wait_for_slave_sql_to_stop.inc
|
include/wait_for_slave_sql_to_stop.inc
|
||||||
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
include/check_slave_param.inc [Exec_Master_Log_Pos]
|
||||||
==== Test various error conditions ====
|
==== Test various error conditions ====
|
||||||
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
|
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS;
|
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until master_log_file='master-bin.000001';
|
start slave until master_log_file='master-bin.000001';
|
||||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until relay_log_file='slave-relay-bin.000002';
|
start slave until relay_log_file='slave-relay-bin.000002';
|
||||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS;
|
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||||
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave sql_thread;
|
start slave sql_thread;
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
|
start slave until master_log_file='master-bin.000001', master_log_pos=776;
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1254 Slave is already running
|
Note 1254 Slave is already running
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
|
@@ -39,17 +39,14 @@ sync_slave_with_master;
|
|||||||
--source include/stop_slave.inc
|
--source include/stop_slave.inc
|
||||||
# Reset slave.
|
# Reset slave.
|
||||||
RESET SLAVE;
|
RESET SLAVE;
|
||||||
--disable_query_log
|
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||||
eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT;
|
eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT;
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
# Try to replicate all queries until drop of t1
|
# Try to replicate all queries until drop of t1
|
||||||
|
|
||||||
connection slave;
|
connection slave;
|
||||||
echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1;
|
--replace_result $master_pos_drop_t1 master_pos_drop_t1
|
||||||
--disable_query_log
|
|
||||||
eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1;
|
eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1;
|
||||||
--enable_query_log
|
|
||||||
--source include/wait_for_slave_sql_to_stop.inc
|
--source include/wait_for_slave_sql_to_stop.inc
|
||||||
|
|
||||||
# Here table should be still not deleted
|
# Here table should be still not deleted
|
||||||
@@ -59,7 +56,6 @@ SELECT * FROM t1;
|
|||||||
--source include/check_slave_param.inc
|
--source include/check_slave_param.inc
|
||||||
|
|
||||||
# This should fail right after start
|
# This should fail right after start
|
||||||
--replace_result 291 MASTER_LOG_POS
|
|
||||||
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
|
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
|
||||||
--source include/wait_for_slave_sql_to_stop.inc
|
--source include/wait_for_slave_sql_to_stop.inc
|
||||||
# again this table should be still not deleted
|
# again this table should be still not deleted
|
||||||
@@ -77,10 +73,8 @@ sync_slave_with_master;
|
|||||||
--source include/stop_slave.inc
|
--source include/stop_slave.inc
|
||||||
|
|
||||||
# This should stop immediately as we are already there
|
# This should stop immediately as we are already there
|
||||||
echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2;
|
--replace_result $master_pos_create_t2 master_pos_create_t2
|
||||||
--disable_query_log
|
|
||||||
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2;
|
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2;
|
||||||
--enable_query_log
|
|
||||||
let $slave_param= Until_Log_Pos;
|
let $slave_param= Until_Log_Pos;
|
||||||
let $slave_param_value= $master_pos_create_t2;
|
let $slave_param_value= $master_pos_create_t2;
|
||||||
--source include/wait_for_slave_param.inc
|
--source include/wait_for_slave_param.inc
|
||||||
@@ -140,9 +134,8 @@ INSERT INTO t1 VALUES (3);
|
|||||||
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
|
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
|
||||||
--source include/get_relay_log_pos.inc
|
--source include/get_relay_log_pos.inc
|
||||||
|
|
||||||
--disable_query_log
|
--replace_result $relay_log_pos relay_log_pos
|
||||||
--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
|
--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
|
||||||
--enable_query_log
|
|
||||||
--source include/wait_for_slave_sql_to_stop.inc
|
--source include/wait_for_slave_sql_to_stop.inc
|
||||||
|
|
||||||
--let $assert_cond= COUNT(*) = 2 FROM t1
|
--let $assert_cond= COUNT(*) = 2 FROM t1
|
||||||
|
@@ -64,7 +64,6 @@ select * from t1;
|
|||||||
--source include/check_slave_param.inc
|
--source include/check_slave_param.inc
|
||||||
|
|
||||||
# this should fail right after start
|
# this should fail right after start
|
||||||
--replace_result 291 MASTER_LOG_POS
|
|
||||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||||
--source include/wait_for_slave_io_to_start.inc
|
--source include/wait_for_slave_io_to_start.inc
|
||||||
--source include/wait_for_slave_sql_to_stop.inc
|
--source include/wait_for_slave_sql_to_stop.inc
|
||||||
@@ -107,22 +106,18 @@ eval start slave until master_log_file='$master_log_file', master_log_pos=$maste
|
|||||||
|
|
||||||
--echo ==== Test various error conditions ====
|
--echo ==== Test various error conditions ====
|
||||||
|
|
||||||
--replace_result 561 MASTER_LOG_POS
|
|
||||||
--error 1277
|
--error 1277
|
||||||
start slave until master_log_file='master-bin', master_log_pos=561;
|
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||||
--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
|
|
||||||
--error 1277
|
--error 1277
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||||
--error 1277
|
--error 1277
|
||||||
start slave until master_log_file='master-bin.000001';
|
start slave until master_log_file='master-bin.000001';
|
||||||
--error 1277
|
--error 1277
|
||||||
start slave until relay_log_file='slave-relay-bin.000002';
|
start slave until relay_log_file='slave-relay-bin.000002';
|
||||||
--replace_result 561 MASTER_LOG_POS
|
|
||||||
--error 1277
|
--error 1277
|
||||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||||
# Warning should be given for second command
|
# Warning should be given for second command
|
||||||
start slave sql_thread;
|
start slave sql_thread;
|
||||||
--replace_result 776 MASTER_LOG_POS
|
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=776;
|
start slave until master_log_file='master-bin.000001', master_log_pos=776;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user