include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, data2 LONGBLOB, PRIMARY KEY(a)); INSERT INTO t1 (data1, data2) VALUES (repeat('a',1000000), repeat('a', 1000000)); DELETE FROM t1 WHERE a = 1; # On master, test the inserted data is deleted SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; LENGTH(data1) LENGTH(data2) SET @@global.max_allowed_packet=4194304; FLUSH LOGS; include/rpl_reset.inc # On master, test the added 'binlog-row-event-max-size' mysqlbinlog option # works fine and the data is inserted by executing the dumped ROW event SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; LENGTH(data1) LENGTH(data2) 1000000 1000000 set @@global.max_allowed_packet= 4194304; INSERT INTO t1 (data1, data2) VALUES (repeat('a',1048576), repeat('a',1048576)); show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT include/sync_slave_sql_with_master.inc # On slave, test the row event data is replicated when the value of # the bigger one of max_allowed_packet and binlog_row_event_max_size # is larger than the required size. SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; LENGTH(data1) LENGTH(data2) 1000000 1000000 # On slave, test the row event data is replicated when the value of # the bigger one of max_allowed_packet and binlog_row_event_max_size # is equal to the required size. SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; LENGTH(data1) LENGTH(data2) 1048576 1048576 DROP TABLE t1; include/sync_slave_sql_with_master.inc include/rpl_reset.inc # Test it will cause ER_MASTER_FATAL_ERROR_READING_BINLOG when the value # of the bigger one of max_allowed_packet and binlog_row_event_max_size # is lower than the the required size. CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)); include/sync_slave_sql_with_master.inc 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)); SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; LENGTH(data1) LENGTH(data2) LENGTH(data3) 4194304 4194304 4194304 drop table t1; include/sync_slave_sql_with_master.inc call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log: .*"); call mtr.add_suppression("Found invalid event in binary log"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); ==== clean up ==== include/stop_slave.inc RESET SLAVE; RESET MASTER; include/rpl_end.inc