| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection master] |
| 6 |
SET SESSION sql_log_bin= 0; |
| 7 |
CALL mtr.add_suppression("==[0-9]*== Warning: set address range perms: large range"); |
| 8 |
SET SESSION sql_log_bin= 1; |
| 9 |
CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, |
| 10 |
data2 LONGBLOB, PRIMARY KEY(a)); |
| 11 |
INSERT INTO t1 (data1, data2) VALUES (repeat('a',1000000), repeat('a', 1000000)); |
| 12 |
DELETE FROM t1 WHERE a = 1; |
| 13 |
# On master, test the inserted data is deleted |
| 14 |
SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; |
| 15 |
LENGTH(data1) LENGTH(data2) |
| 16 |
SET @@global.max_allowed_packet=4194304; |
| 17 |
FLUSH LOGS; |
| 18 |
include/rpl_reset.inc |
| 19 |
# On master, test the added 'binlog-row-event-max-size' mysqlbinlog option |
| 20 |
# works fine and the data is inserted by executing the dumped ROW event |
| 21 |
SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; |
| 22 |
LENGTH(data1) LENGTH(data2) |
| 23 |
1000000 1000000 |
| 24 |
set @@global.max_allowed_packet= 67108864; |
| 25 |
INSERT INTO t1 (data1, data2) VALUES (repeat('a',1048576), repeat('a',1048576)); |
| 26 |
show binlog events from <binlog_start>; |
| 27 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 28 |
master-bin.000001 # Anonymous_Gtid 1 # SET @@SESSION.GTID_NEXT= 'GTID'; |
| 29 |
master-bin.000001 # Query 1 # BEGIN |
| 30 |
master-bin.000001 # Table_map 1 # table_id: # (test.t1) |
| 31 |
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F |
| 32 |
master-bin.000001 # Query 1 # COMMIT |
| 33 |
master-bin.000001 # Anonymous_Gtid 1 # SET @@SESSION.GTID_NEXT= 'GTID'; |
| 34 |
master-bin.000001 # Query 1 # BEGIN |
| 35 |
master-bin.000001 # Table_map 1 # table_id: # (test.t1) |
| 36 |
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F |
| 37 |
master-bin.000001 # Query 1 # COMMIT |
| 38 |
include/sync_slave_sql_with_master.inc |
| 39 |
# On slave, test the row event data is replicated when the value of |
| 40 |
# the bigger one of max_allowed_packet and binlog_row_event_max_size |
| 41 |
# is larger than the required size. |
| 42 |
SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; |
| 43 |
LENGTH(data1) LENGTH(data2) |
| 44 |
1000000 1000000 |
| 45 |
# On slave, test the row event data is replicated when the value of |
| 46 |
# the bigger one of max_allowed_packet and binlog_row_event_max_size |
| 47 |
# is equal to the required size. |
| 48 |
SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; |
| 49 |
LENGTH(data1) LENGTH(data2) |
| 50 |
1048576 1048576 |
| 51 |
DROP TABLE t1; |
| 52 |
include/sync_slave_sql_with_master.inc |
| 53 |
include/rpl_reset.inc |
| 54 |
# Test it will cause ER_SOURCE_FATAL_ERROR_READING_BINLOG when the value |
| 55 |
# of the bigger one of max_allowed_packet and binlog_row_event_max_size |
| 56 |
# is lower than the the required size. |
| 57 |
CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, |
| 58 |
data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)) ROW_FORMAT=DYNAMIC; |
| 59 |
include/sync_slave_sql_with_master.inc |
| 60 |
INSERT INTO t1 (data1, data2, data3) VALUES (repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet)); |
| 61 |
SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; |
| 62 |
LENGTH(data1) LENGTH(data2) LENGTH(data3) |
| 63 |
67108864 67108864 67108864 |
| 64 |
drop table t1; |
| 65 |
include/sync_slave_sql_with_master.inc |
| 66 |
call mtr.add_suppression("Replica I/O: Got fatal error 1236 from source when reading data from binary log: .*"); |
| 67 |
call mtr.add_suppression("Found invalid event in binary log"); |
| 68 |
call mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); |
| 69 |
CALL mtr.add_suppression("==[0-9]*== Warning: set address range perms: large range"); |
| 70 |
==== clean up ==== |
| 71 |
include/stop_slave.inc |
| 72 |
RESET SLAVE; |
| 73 |
Warnings: |
| 74 |
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead |
| 75 |
RESET MASTER; |
| 76 |
include/rpl_end.inc |