Bug #49618 Field length stored incorrectly in binary log for InnoDB
Submitted: 11 Dec 2009 11:13 Modified: 18 Jun 2010 12:52
Reporter: Mats Kindahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S2 (Serious)
Version: OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any

[11 Dec 2009 11:13] Mats Kindahl
Description:
When replicating field length information, it is stored in the table map event in the metadata for the field. Unfortunately, the metadata for Field_bit_as_char, which is used by InnoDB, is rounded up to the nearest multiple of 8.

The field length is stored as a pair <bytes, odd bits> where 'bytes' is the number of complete bytes and 'odd bits' is the extra bits required to correctly represent the length.

For MyISAM, which uses Field_bit to represent a bit field, the metadata for a field of type 'BIT(L)' is set to:

    <floor(L/8), L mod 8>

For InnoDB, which uses Field_bit_as_char to represent a bit field, the metadata for a field of type 'BIT(L)' is set to:

    <ceil(L/8), 0>

This means that exact computations of the field size on the master cannot be done.

How to repeat:
Read the code, or alternatively, try to replicate a BIT(1) field with a version having the patch for WL#5151 applied.

Suggested fix:
Correct the metadata for this field.

This require a change of the data stored in the binary log and replication from old to new server potentially can have problems.
[14 Dec 2009 13:12] Mats Kindahl
The change of binlog format is benign and will at most generate an error.

Replication of the DDL is done as a statement, so that will create an identical table on the slave regardless of the relative versions of the master and slave.

Let us first consider the direction NEW->OLD.

The code on an old slave for checking compatibility is:

  int compatible= 0;
  uint const source_size= pack_length_from_metadata(field_metadata);
  uint const destination_size= row_pack_length();
  uint const from_bit_len= field_metadata & 0x00ff;
  uint const from_len= (field_metadata >> 8U) & 0x00ff;
  if ((bit_len == 0) || (from_bit_len == 0))
    compatible= (source_size <= destination_size);
  else if (from_bit_len > bit_len)
    compatible= (from_len < bytes_in_rec);
  else
    compatible= ((from_bit_len <= bit_len) && (from_len <= bytes_in_rec));
  return (compatible);

If replicating from InnoDB on a new master to InnoDB on a old slave it will mean that bit_len == 0 (and from_bit_len in the range [0,7]), which means that the compatibility is decided by the expression

   source_size <= destination_size

On an old master, the source_size is (field_len + 7) / 8, while on a new master the source_size is field_len / 8.

Since (field_len + 7) / 8 <= field_len / 8, it means that the expression source_size <= destination_size will be true regardless of whether source_size is from an old or a new server.

Let us now consider the direction OLD->NEW.

In this case, the old master will send metadata as given in the bug description, which means that it will take the nearest multiple of 8 higher than the real size. For BIT(3) it will be BIT(8).

This check will then cause the slave to stop with the somewhat strange error message:

  Column N of table <table> cannot be converted from type
  'bit(3)' to type 'bit(3)'

The problem can be eliminated by setting SLAVE_TYPE_CONVERSIONS to include the ALL_LOSSY flag.

The problem can be reproduced on an old server since MyISAM generate correct bits but InnoDB does not. Here is the result of an execution. The size of the bit fields are not correct because of differences in internal computations.

[on master]
CREATE TABLE myisam_to_innodb (a BIT(3)) ENGINE=MyISAM;
CREATE TABLE innodb_to_myisam (a BIT(3)) ENGINE=InnoDB;
[on slave]
ALTER TABLE myisam_to_innodb ENGINE=InnoDB;
ALTER TABLE innodb_to_myisam ENGINE=MyISAM;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
[on master]
INSERT INTO myisam_to_innodb VALUES (b'101');
[on slave]
SELECT bin(a) FROM myisam_to_innodb;
bin(a)
101
[on master]
INSERT INTO innodb_to_myisam VALUES (b'101');
[on slave]
Error: Column 0 of table 'test.innodb_to_myisam' cannot be converted from type 'bit(1)' to type 'bit(3)'
[14 Dec 2009 14:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93916

3181 Mats Kindahl	2009-12-14
      BUG#49618: Field length stored incorrectly in binary log for InnoDB
      
      The class Field_bit_as_char stores the metadata for the field incorrecly
      because bytes_in_rec and bit_len are set to (field_length + 7 ) / 8 and 0
      respectively, while Field_bit has the correct values field_length / 8
      and field_length % 8.
      
      Solved the problem by re-computing the values for the metadata based on
      the field_length instead of using the bytes_in_rec and bit_len variables.
[14 Dec 2009 14:39] Mats Kindahl
Sorry, there's a typo in the previous message. It should read:

"Since [field_len / 8 <= (field_len + 7) / 8], it means that the expression source_size <= destination_size will be true regardless of whether source_size is from an old or a new server."
[15 Dec 2009 11:51] Mats Kindahl
In addition to the workaround of setting ALL_LOSSY in SLAVE_TYPE_CONVERSIONS, it is possible to change the field width of the table on the slave to the nearest multiple of 8 larger than the field width on the master. For example, if the type on the master is BIT(5), then the type on the slave should be BIT(8).

This will mean that the checks will pass and that the value inserted on the master will also be inserted on the slave.
[15 Dec 2009 11:55] Mats Kindahl
The error can be reproduced on 5.1.41 with the following sequence:

  [on master]
  CREATE TABLE t1 (a BIT(8)) ENGINE = INNODB;
  [on slave]
  DROP TABLE t1;
  CREATE TABLE t1 (a BIT(7)) ENGINE = MyISAM;
  [on master]
  INSERT INTO t1 VALUES (b'11100101');
  SELECT bin(a) FROM t1;
  bin(a)
  11100101
  [on slave]
  SELECT bin(a) FROM t1;
  bin(a)
  1111111
  [on master]
  DROP TABLE t1;
[15 Dec 2009 15:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/94161

3182 Mats Kindahl	2009-12-15
      BUG#49618: Field length stored incorrectly in binary log
                 for InnoDB
      
      The class Field_bit_as_char stores the metadata for the
      field incorrecly because bytes_in_rec and bit_len are set
      to (field_length + 7 ) / 8 and 0 respectively, while
      Field_bit has the correct values field_length / 8 and
      field_length % 8.
      
      Solved the problem by re-computing the values for the
      metadata based on the field_length instead of using the
      bytes_in_rec and bit_len variables.
      
      To handle compatibility with old server, a table map
      flag was added to indicate that the bit computation is
      exact. If the flag is clear, the slave computes the
      number of bytes required to store the bit field and
      compares that instead, effectively allowing replication
      *without conversion* from any field length that require
      the same number of bytes to store.
     @ mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        Adding test to check compatibility for bit field
        replication when using InnoDB.
     @ sql/field.cc
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
     @ sql/field.h
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
     @ sql/log.cc
        Removing table map flags since they are not used
        outside table map class.
     @ sql/log_event.cc
        Removing flags parameter from table map constructor
        since it is not used and does not have to be exposed.
     @ sql/log_event.h
        Adding flag to denote that bit length for bit field type
        is exact and not potentially rounded to even bytes.
     @ sql/rpl_utility.cc
        Adding fields to table_def to store table map flags.
     @ sql/rpl_utility.h
        Removing obsolete comment and adding flags to store
        table map flags from master.
[18 Jan 2010 12:06] Bugs System
Pushed into 6.0.14-alpha (revid:alik@ibmvm-20100118120357-hnzhgadkpzqfnvsc) (version source revid:alik@ibmvm-20100118115413-kd3klpine09yyktw) (merge vers: 6.0.14-alpha) (pib:16)
[18 Jan 2010 12:07] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100118120111-73dulkgc893it4r9) (version source revid:alik@ibmvm-20100118115335-0stecyzftqm7bqx6) (pib:16)
[19 Jan 2010 11:08] Jon Stephens
Documented bugfix in the 5.6.0 and 6.0.14 changelogs, as follows:

        Column length information generated by InnoDB did not match that
        generated by MyISAM, which caused invalid metadata to be written
        to the binary log when trying to replicate BIT() columns.

Set NDI state, waiting for futher merges.
[23 Jan 2010 0:10] Jon Stephens
Still waiting for 5.1 merge/version info.
[12 Feb 2010 14:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/100135

3092 Martin Skold	2010-02-12 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
[12 Feb 2010 14:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/100142

3405 Martin Skold	2010-02-12 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
        storage/ndb/tools/restore/consumer_restore.cpp
[19 Feb 2010 13:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/100868

3412 Martin Skold	2010-02-19 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
        storage/ndb/tools/restore/consumer_restore.cpp
[24 Feb 2010 16:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/101348

3433 Martin Skold	2010-02-24 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
        storage/ndb/CMakeLists.txt
[2 Mar 2010 11:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/102019

3474 Martin Skold	2010-03-02 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
[2 Mar 2010 11:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/102020

3414 Martin Skold	2010-03-02 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
[2 Mar 2010 12:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/102022

3115 Martin Skold	2010-03-02 [merge]
      Merge
      added:
        mysql-test/extra/rpl_tests/check_type.inc
        mysql-test/extra/rpl_tests/type_conversions.test
        mysql-test/suite/rpl/r/rpl_typeconv.result
        mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
        mysql-test/suite/rpl/t/rpl_typeconv-slave.opt
        mysql-test/suite/rpl/t/rpl_typeconv.test
        mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
      modified:
        .bzrignore
        client/Makefile.am
        client/mysqlbinlog.cc
        libmysqld/Makefile.am
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/r/mysqlbinlog_row_innodb.result
        mysql-test/r/mysqlbinlog_row_myisam.result
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/rpl/r/rpl_bug31076.result
        mysql-test/suite/rpl/r/rpl_colSize.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/t/rpl_bug31076.test
        mysql-test/suite/rpl/t/rpl_colSize.test
        mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        sql/field.cc
        sql/field.h
        sql/log.cc
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/rpl_record.cc
        sql/rpl_rli.h
        sql/rpl_utility.cc
        sql/rpl_utility.h
        sql/set_var.cc
        sql/set_var.h
        sql/share/errmsg.txt
        sql/sql_class.h
        sql/sql_select.cc
[2 Mar 2010 12:04] Bugs System
Pushed into 5.1.41-ndb-6.3.33 (revid:martin.skold@mysql.com-20100302115132-qhkzoqk0ksqgziiv) (version source revid:martin.skold@mysql.com-20100302115132-qhkzoqk0ksqgziiv) (merge vers: 5.1.41-ndb-6.3.33) (pib:16)
[2 Mar 2010 12:05] Bugs System
Pushed into 5.1.41-ndb-7.0.14 (revid:martin.skold@mysql.com-20100302120047-al65h1bcqmd3cem0) (version source revid:martin.skold@mysql.com-20100302115137-ewrkhhxkkj0q1yza) (merge vers: 5.1.41-ndb-7.0.14) (pib:16)
[3 Mar 2010 5:01] Jon Stephens
Also documented in the NDB-6.3.33 and 7.0.14 changelogs.

Set to NDI because we need to know if this will actually go into 5.1-main or not (tagged SR51MRU).

If 'Yes', please set to Need Merge; otherwise, this can be closed.

Thanks.
[6 Mar 2010 11:04] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@linux-rbsx-20100118220048-5vnyqi5ghsbgmdsd) (merge vers: 5.5.99-m3) (pib:16)
[8 Mar 2010 0:00] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.

Setting report back to NDI per Jon's previous comment.
[17 Mar 2010 14:29] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/103607

3195 Mats Kindahl	2010-03-17
      BUG#49618: Field length stored incorrectly in binary log
                 for InnoDB
                  
      The class Field_bit_as_char stores the metadata for the
      field incorrecly because bytes_in_rec and bit_len are set
      to (field_length + 7 ) / 8 and 0 respectively, while
      Field_bit has the correct values field_length / 8 and
      field_length % 8.
                  
      Solved the problem by re-computing the values for the
      metadata based on the field_length instead of using the
      bytes_in_rec and bit_len variables.
                  
      To handle compatibility with old server, a table map
      flag was added to indicate that the bit computation is
      exact. If the flag is clear, the slave computes the
      number of bytes required to store the bit field and
      compares that instead, effectively allowing replication
      *without conversion* from any field length that require
      the same number of bytes to store.
     @ mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
        Adding test to check compatibility for bit field
        replication when using InnoDB
     @ sql/field.cc
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
     @ sql/field.h
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
     @ sql/log.cc
        Removing table map flags since they are not used
        outside table map class.
     @ sql/log_event.cc
        Removing flags parameter from table map constructor
        since it is not used and does not have to be exposed.
     @ sql/log_event.h
        Adding flag to denote that bit length for bit field type
        is exact and not potentially rounded to even bytes.
     @ sql/rpl_utility.cc
        Adding fields to table_def to store table map flags.
     @ sql/rpl_utility.h
        Removing obsolete comment and adding flags to store
        table map flags from master.
[17 Mar 2010 18:52] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/103628

3979 Mats Kindahl	2010-03-17 [merge]
      Null-merging back-ported patch to BUG#49618 from mysql-5.1-bugteam to mysql-pe.
[22 Mar 2010 12:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/103967

3415 Mats Kindahl	2010-03-22
      BUG#49618: Field length stored incorrectly in binary log
                 for InnoDB
      
      Patch to fix result files for the binlog suite under row-
      based replication.
[26 Mar 2010 8:20] Bugs System
Pushed into 5.5.4-m3 (revid:alik@sun.com-20100326080914-2pz8ns984e0spu03) (version source revid:alexey.kopytov@sun.com-20100322132851-8j3m42x4ldi1kca5) (merge vers: 5.5.3-m2) (pib:16)
[26 Mar 2010 8:24] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100326081116-m3v4l34yhr43mtsv) (version source revid:alik@sun.com-20100325072612-4sds00ix8ajo1e84) (pib:16)
[26 Mar 2010 8:29] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100326081944-qja07qklw1p2w7jb) (version source revid:alik@sun.com-20100325073410-4t4i9gu2u1pge7xb) (merge vers: 6.0.14-alpha) (pib:16)
[29 Mar 2010 12:55] Jon Stephens
Still waiting for merge to 5.1-main.
[6 Apr 2010 7:58] Bugs System
Pushed into 5.1.46 (revid:sergey.glukhov@sun.com-20100405111026-7kz1p8qlzglqgfmu) (version source revid:bar@mysql.com-20100322122953-0iu7rnkuhutxaxtd) (merge vers: 5.1.46) (pib:16)
[6 Apr 2010 10:38] Jon Stephens
Already documented in the 5.5.3 and 6.0.14 changelogs. Added changelog entry for 5.1.46. Closed.
[17 Jun 2010 12:15] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:02] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:martin.skold@mysql.com-20100609211156-tsac5qhw951miwtt) (merge vers: 5.1.46-ndb-6.2.19) (pib:16)
[17 Jun 2010 13:42] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)