mirror of
https://github.com/MariaDB/server.git
synced 2025-10-19 21:09:40 +03:00
been reached): Post-merge patch to handle all the changes to the tree since the tree was cloned. mysql-test/extra/rpl_tests/rpl_log.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/extra/rpl_tests/rpl_reset_slave.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/include/show_slave_status.inc: Column change. mysql-test/r/rpl_000015.result: Result file change. mysql-test/r/rpl_change_master.result: Result file change. mysql-test/r/rpl_empty_master_crash.result: Result file change. mysql-test/r/rpl_extraCol_innodb.result: Result file change. mysql-test/r/rpl_extraCol_myisam.result: Result file change. mysql-test/r/rpl_flushlog_loop.result: Result file change. mysql-test/r/rpl_incident.result: Result file change. mysql-test/r/rpl_known_bugs_detection.result: Result file change. mysql-test/r/rpl_loaddata.result: Result file change. mysql-test/r/rpl_loaddata_fatal.result: Result file change. mysql-test/r/rpl_log_pos.result: Result file change. mysql-test/r/rpl_ndb_basic.result: Result file change. mysql-test/r/rpl_ndb_circular.result: Result file change. mysql-test/r/rpl_ndb_extraCol.result: Result file change. mysql-test/r/rpl_ndb_idempotent.result: Result file change. mysql-test/r/rpl_ndb_log.result: Result file change. mysql-test/r/rpl_ndb_sync.result: Result file change. mysql-test/r/rpl_rbr_to_sbr.result: Result file change. mysql-test/r/rpl_redirect.result: Result file change. mysql-test/r/rpl_replicate_do.result: Result file change. mysql-test/r/rpl_rotate_logs.result: Result file change. mysql-test/r/rpl_row_inexist_tbl.result: Result file change. mysql-test/r/rpl_row_log.result: Result file change. mysql-test/r/rpl_row_log_innodb.result: Result file change. mysql-test/r/rpl_row_max_relay_size.result: Result file change. mysql-test/r/rpl_row_reset_slave.result: Result file change. mysql-test/r/rpl_row_tabledefs_2myisam.result: Result file change. mysql-test/r/rpl_row_tabledefs_3innodb.result: Result file change. mysql-test/r/rpl_row_until.result: Result file change. mysql-test/r/rpl_server_id1.result: Result file change. mysql-test/r/rpl_server_id2.result: Result file change. mysql-test/r/rpl_slave_skip.result: Result file change. mysql-test/r/rpl_ssl.result: Result file change. mysql-test/r/rpl_ssl1.result: Result file change. mysql-test/r/rpl_stm_log.result: Result file change. mysql-test/r/rpl_stm_max_relay_size.result: Result file change. mysql-test/r/rpl_stm_reset_slave.result: Result file change. mysql-test/r/rpl_stm_until.result: Result file change. mysql-test/t/rpl_000015.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_change_master.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_empty_master_crash.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_log_pos.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_ndb_basic.test: Column position change. mysql-test/t/rpl_ndb_idempotent.test: Column position change. mysql-test/t/rpl_ndb_sync.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_redirect.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_replicate_do.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_rotate_logs.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_row_inexist_tbl.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_row_until.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_server_id1.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_server_id2.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_slave_status.test: Column position change. mysql-test/t/rpl_ssl.test: Column position change. mysql-test/t/rpl_ssl1.test: Column position change. mysql-test/t/rpl_stm_until.test: Replacing SHOW SLAVE STATUS with include file. sql/log_event.cc: Using member function last_error() instead of member variable. Replacing use of 'table' with 'm_table'. Suppressing warnings in debug printout. Setting thd->net.last_error on error return from unpack_row() to get a non-zero error message. The error codes for are being harmonized in another worklog. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_mi.h: Moving order of include files since they are dependent (!). sql/rpl_record.cc: Adding missing include file. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_record_old.cc: Adding missing include file. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_reporting.cc: Adding const modifier to member function. Using renamed member variable m_last_error. sql/rpl_reporting.h: Adding missing constant MAX_SLAVE_ERRMSG. Adding const modifier to Slave_reporting_capability::report(). Hiding and renaming member variable last_error and incorporating member function for access in order to make it mutable. sql/rpl_rli.h: Moving constant MAX_SLAVE_ERRMSG. sql/rpl_utility.cc: Adding missing include file rpl_rli.h. sql/slave.cc: Replacing use of member variable last_error with call to member function last_error(). Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
118 lines
3.6 KiB
Plaintext
118 lines
3.6 KiB
Plaintext
--source include/have_ndb.inc
|
|
--source include/have_binlog_format_row.inc
|
|
--source include/master-slave.inc
|
|
|
|
#
|
|
# Currently test only works with ndb since it retrieves "old"
|
|
# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
|
|
#
|
|
|
|
# create a table with one row
|
|
CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
|
|
INSERT INTO t1 VALUES ("row1","will go away",1);
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
|
|
# sync slave and retrieve epoch
|
|
sync_slave_with_master;
|
|
--replace_column 1 <the_epoch>
|
|
SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
|
|
let $the_epoch= `select @the_epoch` ;
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
|
|
# get the master binlog pos from the epoch
|
|
connection master;
|
|
--replace_result $the_epoch <the_epoch>
|
|
--replace_column 1 <the_pos>
|
|
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
|
FROM mysql.ndb_binlog_index WHERE epoch = $the_epoch ;
|
|
let $the_pos= `SELECT @the_pos` ;
|
|
let $the_file= `SELECT @the_file` ;
|
|
|
|
# insert some more values
|
|
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
|
|
DELETE FROM t1 WHERE c3 = 1;
|
|
UPDATE t1 SET c2="should go away" WHERE c3 = 2;
|
|
UPDATE t1 SET c2="C" WHERE c3 = 3;
|
|
DELETE FROM t1 WHERE c3 = 2;
|
|
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
|
|
# check that we have it on the slave
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
|
|
SHOW SLAVE STATUS;
|
|
|
|
# stop slave and reset position to before the last changes
|
|
STOP SLAVE;
|
|
--replace_result $the_pos <the_pos>
|
|
eval CHANGE MASTER TO
|
|
master_log_file = '$the_file',
|
|
master_log_pos = $the_pos ;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
|
|
SHOW SLAVE STATUS;
|
|
|
|
# start the slave again
|
|
# -> same events should have been applied again
|
|
# e.g. inserting rows that already there
|
|
# deleting a row which is not there
|
|
# updating a row which is not there
|
|
START SLAVE;
|
|
|
|
--connection master
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
SELECT * FROM t1 ORDER BY c3;
|
|
|
|
STOP SLAVE;
|
|
|
|
#
|
|
# cleanup
|
|
#
|
|
--connection master
|
|
DROP TABLE t1;
|
|
RESET master;
|
|
--connection slave
|
|
DROP TABLE t1;
|
|
RESET slave;
|
|
|
|
START SLAVE;
|
|
|
|
#
|
|
# Test that we can handle update of a row that does not exist on the slave
|
|
# will trigger usage of AO_IgnoreError on slave side so that the INSERT
|
|
# still succeeds even if the replication of the UPDATE generates an error.
|
|
#
|
|
--connection master
|
|
CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
|
|
INSERT INTO t1 VALUES ("row1","remove on slave",1);
|
|
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
DELETE FROM t1;
|
|
|
|
--connection master
|
|
BEGIN;
|
|
UPDATE t1 SET c2="does not exist" WHERE c3=1;
|
|
INSERT INTO t1 VALUES ("row2","new on slave",2);
|
|
COMMIT;
|
|
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
SELECT * FROM t1;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
|
|
SHOW SLAVE STATUS;
|
|
|
|
connection master;
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
# End of 5.1 Test
|
|
-- source include/master-slave-end.inc
|