###################################################################### # Bug#35199996 table map entry for certain table were logged in to the # binlogs even though the log_replica_updates is disabled ###################################################################### CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB; SET @save_debug= @@GLOBAL.debug; SET @@GLOBAL.debug="+d,ndb_binlog_log_table_maps"; SET @@GLOBAL.debug= @save_debug; # Show data written SELECT * FROM test_log_table_maps ORDER BY id; id what 1 change from non replica 2 change from replica 3 change from non replica 4 change from replica 5 change from first replica 6 change from second replica 7 no logging change from replica 8 no logging change from non-replica 9 change from replica 10 no logging change from non-replica 11 no logging change from non-replica 12 read-op change from non-replica 13 no logging change from replica 14 read-op change from replica 15 read-op change from non-replica 16 read-op change from replica include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info binlog.000001 # Query # # use `test`; CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT # Verify server1 Binlog changes # Some rows are not logged because no-logging bit was set include/ndb_binlog_verify_table.inc SELECT * FROM verify.test_log_table_maps ORDER BY id; id what 1 change from non replica 2 change from replica 3 change from non replica 4 change from replica 5 change from first replica 6 change from second replica 9 change from replica 12 read-op change from non-replica 14 read-op change from replica 15 read-op change from non-replica 16 read-op change from replica [connection server2] include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info binlog.000001 # Query # # use `test`; CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT binlog.000001 # Query # # BEGIN binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps) binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) binlog.000001 # Write_rows # # table_id: # binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F binlog.000001 # Query # # COMMIT # Verify server2 Binlog changes # Additional rows are not logged because server2 does NOT log replica updates include/ndb_binlog_verify_table.inc SELECT * FROM verify.test_log_table_maps ORDER BY id; id what 1 change from non replica 3 change from non replica 12 read-op change from non-replica 14 read-op change from replica 15 read-op change from non-replica 16 read-op change from replica [connection server1] DROP TABLE test_log_table_maps; ###################################################################### # Bug#37953883 table map entry is logged in binlog for create table # statements when sql_log_bin is disabled for the session. ###################################################################### [connection server2] SET sql_log_bin=0; SET @save_debug= @@GLOBAL.debug; SET @@GLOBAL.debug="+d,ndb_binlog_verify_table_maps"; CREATE TABLE test_blob_log_table_maps (id INT PRIMARY KEY, b BLOB, lb LONGBLOB, lt LONGTEXT) ENGINE = NDB; INSERT INTO test_blob_log_table_maps VALUES (1, repeat("!", 512), repeat("@", 512), repeat("#", 512)), (2, repeat("!", 512), repeat("$", 512), repeat("&", 512)), (3, repeat("!", 512), repeat("%", 512), repeat("^", 512)), (4, repeat("!", 512), repeat("*", 512), repeat("~", 512)); # Should not abort SELECT id FROM test_blob_log_table_maps ORDER by id; id 1 2 3 4 UPDATE test_blob_log_table_maps SET lb = repeat("+", 256), lt = repeat("-", 128) WHERE id BETWEEN 1 and 4; SELECT COUNT(lb), COUNT(lt) FROM test_blob_log_table_maps; COUNT(lb) COUNT(lt) 4 4 DELETE FROM test_blob_log_table_maps; SELECT COUNT(*) FROM test_blob_log_table_maps; COUNT(*) 0 # Cleanup SET @@GLOBAL.debug = @save_debug; SET sql_log_bin=1; DROP TABLE test_blob_log_table_maps;