1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #13601: Wrong int type for bit

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.
This commit is contained in:
jimw@mysql.com
2006-04-04 17:54:58 -07:00
parent 0903941d05
commit 1a59580dcd
8 changed files with 75 additions and 39 deletions

View File

@ -192,7 +192,8 @@ void key_restore(byte *to_record, byte *from_key, KEY *key_info,
Field_bit *field= (Field_bit *) (key_part->field);
if (field->bit_len)
{
uchar bits= *(from_key + key_part->length - field->field_length -1);
uchar bits= *(from_key + key_part->length -
field->pack_length_in_rec() - 1);
set_rec_bits(bits, to_record + key_part->null_offset +
(key_part->null_bit == 128),
field->bit_ofs, field->bit_len);