mirror of
https://github.com/MariaDB/server.git
synced 2025-03-13 10:38:37 +01:00
WL#3339 (Issue warnings when statement-based replication may fail):
Adding missing test files. Result change in test rpl_udf.
This commit is contained in:
parent
5368479a8c
commit
3269db6ee3
3 changed files with 215 additions and 0 deletions
136
mysql-test/r/rpl_slave_skip.result
Normal file
136
mysql-test/r/rpl_slave_skip.result
Normal file
|
@ -0,0 +1,136 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
**** On Slave ****
|
||||
STOP SLAVE;
|
||||
**** On Master ****
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
CREATE TABLE t2 (c INT, d INT);
|
||||
INSERT INTO t1 VALUES (1,1),(2,4),(3,9);
|
||||
INSERT INTO t2 VALUES (1,1),(2,8),(3,27);
|
||||
UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT)
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (c INT, d INT)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Update_rows # # table_id: #
|
||||
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 1
|
||||
2 8
|
||||
3 27
|
||||
SELECT * FROM t2;
|
||||
c d
|
||||
1 2
|
||||
2 16
|
||||
3 54
|
||||
**** On Slave ****
|
||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=484;
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 714
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 484
|
||||
Relay_Log_Space #
|
||||
Until_Condition Master
|
||||
Until_Log_File master-bin.000001
|
||||
Until_Log_Pos 484
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 1
|
||||
2 4
|
||||
3 9
|
||||
SELECT * FROM t2;
|
||||
c d
|
||||
1 1
|
||||
2 8
|
||||
3 27
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
||||
SET @foo = 12;
|
||||
INSERT INTO t1 VALUES(@foo, 2*@foo);
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # User var # # @`foo`=12
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
|
||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 248
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running Yes
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 248
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
**** On Master ****
|
||||
DROP TABLE t1, t2;
|
|
@ -181,12 +181,20 @@ affected rows: 2
|
|||
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
|
||||
affected rows: 0
|
||||
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
|
||||
Warnings:
|
||||
Warning 1588 Statement is not safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
|
||||
Warnings:
|
||||
Warning 1588 Statement is not safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
|
||||
Warnings:
|
||||
Warning 1588 Statement is not safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
|
||||
Warnings:
|
||||
Warning 1588 Statement is not safe to log in statement format.
|
||||
affected rows: 1
|
||||
SELECT * FROM t1 ORDER BY sum;
|
||||
sum price
|
||||
|
|
71
mysql-test/t/rpl_slave_skip.test
Normal file
71
mysql-test/t/rpl_slave_skip.test
Normal file
|
@ -0,0 +1,71 @@
|
|||
source include/master-slave.inc;
|
||||
|
||||
--echo **** On Slave ****
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
CREATE TABLE t2 (c INT, d INT);
|
||||
INSERT INTO t1 VALUES (1,1),(2,4),(3,9);
|
||||
INSERT INTO t2 VALUES (1,1),(2,8),(3,27);
|
||||
UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# These tables should be changed
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
save_master_pos;
|
||||
|
||||
--echo **** On Slave ****
|
||||
connection slave;
|
||||
|
||||
# Stop when reaching the the first table map event.
|
||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=484;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 23 # 33 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
|
||||
# Now we skip *one* table map event. If the execution starts right
|
||||
# after that table map event, *one* of the involved tables will be
|
||||
# changed.
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
sync_with_master;
|
||||
|
||||
# These values should be what was inserted, not what was
|
||||
# updated. Since we are skipping the first table map of the group
|
||||
# representing the UPDATE statement above, we should skip the entire
|
||||
# group and not start executing at the first table map.
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
connection master;
|
||||
RESET MASTER;
|
||||
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
||||
SET @foo = 12;
|
||||
INSERT INTO t1 VALUES(@foo, 2*@foo);
|
||||
save_master_pos;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
connection slave;
|
||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
|
||||
wait_for_slave_to_stop;
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 23 # 33 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
DROP TABLE t1, t2;
|
||||
sync_slave_with_master;
|
Loading…
Add table
Reference in a new issue