summaryrefslogtreecommitdiff
path: root/sql/key.cc
diff options
context:
space:
mode:
authorjimw@mysql.com <>2006-04-04 17:54:58 -0700
committerjimw@mysql.com <>2006-04-04 17:54:58 -0700
commit1a59580dcde7b01de1b3e87a6f55a937decbedf8 (patch)
tree470f8546a50589e9c092da9005875129175816e0 /sql/key.cc
parent0903941d053e1bfba7e6265c4150e3a4fa6995cb (diff)
downloadmariadb-git-1a59580dcde7b01de1b3e87a6f55a937decbedf8.tar.gz
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.
Diffstat (limited to 'sql/key.cc')
-rw-r--r--sql/key.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/key.cc b/sql/key.cc
index 9d86095f33e..75161e4f616 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -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);