mariadb/mysql-test/suite/binlog/t
Luis Soares f8758031f3 BUG#50018: binlog corruption when table has many columns
For tables with metadata sizes ranging from 251 to 255 the size
of the event data (m_data_size) was being improperly calculated
in the Table_map_log_event constructor. This was due to the fact
that when writing the Table_map_log_event body (in
Table_map_log_event::write_data_body) a call to net_store_length
is made for packing the m_field_metadata_size. It happens that
net_store_length uses *one* byte for storing
m_field_metadata_size when it is smaller than 251 but *three*
bytes when it exceeds that value. BUG 42749 had already
pinpointed and fix this fact, but the fix was incomplete, as the
calculation in the Table_map_log_event constructor considers 255
instead of 251 as the threshold to increment m_data_size by
three. Thence, the window for having a mismatch between the
number of bytes written and the number of bytes accounted in the
event length (m_data_size) was left open for
m_field_metadata_size values between 251 and 255.

We fix this by changing the condition in the Table_map_log_event
constructor to match the one in the net_store_length, ie,
increment one byte if m_field_metadata_size < 251 and three if it
exceeds this value.

mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result:
  Updated result file.
mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test:
  Changes to the original test case: added slave and moved
  file into the rpl suite.
  
  New test case: replicates two tables one with 250 and 
  another with 252 metadata sizes. This exercises the usage
  of 1 or 3 bytes while packing the m_field_metadata_size.
sql/log_event.cc:
  Made the m_data_size calculation for the table map log event
  to match the number of bytes used while packing the 
  m_field_metadata_size value (according to net_store_length
  function in pack.c).
2010-01-06 00:44:31 +00:00
..
binlog_auto_increment_bug33029-master.opt BUG#33029 5.0 to 5.1 replication fails on dup key when inserting 2008-03-14 11:35:41 +08:00
binlog_auto_increment_bug33029.test Bug #40559 assertion failed in check_binlog_magic 2009-03-06 20:19:29 +02:00
binlog_base64_flag.test BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars 2008-06-30 22:11:18 +02:00
binlog_database.test Bug#32435: 2007-11-16 15:55:22 +01:00
binlog_delete_and_flush_index.test BUG#34582: FLUSH LOGS does not close and reopen the binlog index 2009-10-20 09:39:40 +01:00
binlog_grant.test Bug #39106: 2008-09-09 12:19:31 +02:00
binlog_incident-master.opt Bug #44442: Incident events are silent in mysqlbinlog output 2009-05-11 13:32:38 +02:00
binlog_incident.test Bug#46010 main.ctype_gbk_binlog fails sporadically : Table 't2' already exists 2009-09-07 13:42:54 +08:00
binlog_index.test Post-push fix for BUG#45292. 2009-12-08 16:03:19 +00:00
binlog_innodb.test Fix a few problems after latest bunch of InnoDB snapshot changes: 2009-01-08 03:06:54 +01:00
binlog_innodb_row.test Bug #40221 Replication failure on RBR + UPDATE the primary key 2008-12-08 17:07:08 +02:00
binlog_killed.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
binlog_killed_simulate-master.opt bug#27571 merging. Fixing offsets and moving tests to the corrent 2007-10-31 11:48:49 +02:00
binlog_killed_simulate.test Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
binlog_mix_innodb_stat.test Bug#37312: Make test binlog_{row,stm}_innodb_stat more robust 2008-09-08 16:23:55 -04:00
binlog_mixed_failure_mixing_engines.test BUG#47287 RBR: replication diff on basic case with txn- and non-txn tables in a statement 2009-10-06 01:38:58 +01:00
binlog_multi_engine.test Bug #38360: BLACKHOLE replication with RBR is broken 2008-10-02 11:02:38 +02:00
binlog_old_versions.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1 2008-02-07 12:38:13 +01:00
binlog_row_binlog-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_binlog.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_ctype_cp932.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_ctype_ucs.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_drop_tmp_tbl.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_failure_mixing_engines.test BUG#47287 RBR: replication diff on basic case with txn- and non-txn tables in a statement 2009-10-06 01:38:58 +01:00
binlog_row_innodb_stat-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_innodb_stat.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_insert_select.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_mix_innodb_myisam-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_row_mix_innodb_myisam.test Post-merge fixes to make tests pass. 2008-01-11 13:25:26 +01:00
binlog_row_mysqlbinlog_db_filter.test Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction 2009-09-30 10:31:25 +08:00
binlog_row_mysqlbinlog_verbose.test Attempt to fix Windows testcase output issue 2009-10-14 21:25:11 +08:00
binlog_sql_mode.test BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE 2009-02-28 09:35:18 +08:00
binlog_start_comment.test Merge 5.0 -> 5.1 2008-09-30 15:32:35 -04:00
binlog_statement_insert_delayed.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_binlog-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_binlog.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_blackhole.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_ctype_cp932.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_ctype_ucs.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_do_db-master.opt BUG#42829: binlogging enabled for all schemas regardless of 2009-09-24 15:52:52 +01:00
binlog_stm_do_db.test BUG#42829: binlogging enabled for all schemas regardless of 2009-09-24 15:52:52 +01:00
binlog_stm_drop_tmp_tbl.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_innodb_stat-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_innodb_stat.test Bug#37312: Make test binlog_{row,stm}_innodb_stat more robust 2008-09-08 16:23:55 -04:00
binlog_stm_insert_select.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_mix_innodb_myisam-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
binlog_stm_mix_innodb_myisam.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
binlog_stm_ps.test BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode 2008-03-25 17:28:12 +04:00
binlog_stm_row.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
binlog_stm_unsafe_warning-master.opt Bug#46265: Can not disable warning about unsafe statements for binary logging 2009-07-31 10:00:35 -03:00
binlog_stm_unsafe_warning.test BUG#47129 fix small bug in test 2009-10-08 14:00:43 +02:00
binlog_tmp_table.test Bug#46010 main.ctype_gbk_binlog fails sporadically : Table 't2' already exists 2009-09-07 13:42:54 +08:00
binlog_truncate_innodb-master.opt Bug #36763 2009-02-06 17:06:41 +01:00
binlog_truncate_innodb.test Bug #36763 2009-02-10 22:26:37 +01:00
binlog_truncate_myisam.test Bug #36763 2009-02-10 22:26:37 +01:00
binlog_unsafe.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
disabled.def Bug #36763 2009-02-06 17:06:41 +01:00