summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-01-16 23:00:21 +0100
committerSergei Golubchik <serg@mariadb.org>2018-01-16 23:29:48 +0100
commit444587d8a3c4b91421cd4cfd7bda2e3f4d1aebe4 (patch)
tree2da20b69c9345c8b66b66863b743511bd59c4759 /sql/field_conv.cc
parent5e7593add405f07ac6a7d755ae1349fb1d2eafd4 (diff)
downloadmariadb-git-444587d8a3c4b91421cd4cfd7bda2e3f4d1aebe4.tar.gz
BIT field woes
* get_rec_bits() was always reading two bytes, even if the bit field contained only of one byte * In various places the code used field->pack_length() bytes starting from field->ptr, while it should be field->pack_length_in_rec() * Field_bit::key_cmp and Field_bit::cmp_max passed field_length as an argument to memcmp(), but field_length is the number of bits!
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 5781f1da576..09792aa1660 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -589,7 +589,7 @@ void Copy_field::set(uchar *to,Field *from)
{
from_ptr=from->ptr;
to_ptr=to;
- from_length=from->pack_length();
+ from_length=from->pack_length_in_rec();
if (from->maybe_null())
{
from_null_ptr=from->null_ptr;
@@ -640,9 +640,9 @@ void Copy_field::set(Field *to,Field *from,bool save)
from_field=from;
to_field=to;
from_ptr=from->ptr;
- from_length=from->pack_length();
+ from_length=from->pack_length_in_rec();
to_ptr= to->ptr;
- to_length=to_field->pack_length();
+ to_length=to_field->pack_length_in_rec();
// set up null handling
from_null_ptr=to_null_ptr=0;