• unknown's avatar
    Bug #13601: Wrong int type for bit · b3b626c3
    unknown authored
      The wrong value was being reported as the field_length for BIT
      fields, resulting in confusion for at least Connector/J. The
      field_length is now always the number of bits in the field, as
      it should be.
    
    
    mysql-test/r/type_bit.result:
      Add new results
    mysql-test/r/type_bit_innodb.result:
      Add new results
    mysql-test/t/type_bit.test:
      Add new regression test
    mysql-test/t/type_bit_innodb.test:
      Add new regression test
    sql/field.cc:
      Fix Field_bit->field_length to actually report the display width, and
      store the bytes stored in the rec in the new bytes_in_rec member.
    sql/field.h:
      Fix Field_bit::field_length to store the correct value, adding
      Field_bit::bytes_in_rec to remember the number of bytes used for
      storing the value. Remove Field_bit_as_char::create_length, as it
      is now redundant.
    sql/ha_ndbcluster.cc:
      Handle field_length of Field_bit actually being the display width (# of bits).
    sql/key.cc:
      Fix inappropriate use of field->field_length for BIT field.
    b3b626c3
field.h 58.9 KB