summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-04-09 10:26:39 -0700
committerIgor Babaev <igor@askmonty.org>2013-04-09 10:26:39 -0700
commit549ada35b0ae2f5a5728243cd6be0fe8f873c792 (patch)
tree40fa3fc06f9549cd26c279b156322b726bc13765 /sql/field.cc
parent1db675b6e8f438a6764c8ba7ee7780cd2fa7e04f (diff)
downloadmariadb-git-549ada35b0ae2f5a5728243cd6be0fe8f873c792.tar.gz
Fixed valgrind complain on usage of uninitialized data.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 7eba901d46b..e543689bef9 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -6202,16 +6202,15 @@ double Field_str::middle_point_pos(Field *min, Field *max)
uchar minp_prefix[sizeof(ulonglong)];
uchar maxp_prefix[sizeof(ulonglong)];
ulonglong mp, minp, maxp;
- uint dsz= min(field_length, sizeof(ulonglong) * charset()->mbmaxlen);
- memset(mp_prefix, 0, sizeof(ulonglong));
- memset(minp_prefix, 0, sizeof(ulonglong));
- memset(maxp_prefix, 0, sizeof(ulonglong));
my_strnxfrm(charset(), mp_prefix, sizeof(mp),
- ptr + length_size(), dsz);
+ ptr + length_size(),
+ data_length());
my_strnxfrm(charset(), minp_prefix, sizeof(minp),
- min->ptr + length_size(), dsz);
+ min->ptr + length_size(),
+ min->data_length());
my_strnxfrm(charset(), maxp_prefix, sizeof(maxp),
- max->ptr + length_size(), dsz);
+ max->ptr + length_size(),
+ max->data_length());
mp= char_prefix_to_ulonglong(mp_prefix);
minp= char_prefix_to_ulonglong(minp_prefix);
maxp= char_prefix_to_ulonglong(maxp_prefix);