Commit d130cef4 authored by Igor Babaev's avatar Igor Babaev

Fixed the problem of mdev-6198: statistics.test fails in valgrind.

The problem appeared when a loose scan used a key prefix whose
last component called uint3korr in the implementation of the key_cmp
virtual function.
parent 32392c05
...@@ -13756,14 +13756,20 @@ int QUICK_GROUP_MIN_MAX_SELECT::init() ...@@ -13756,14 +13756,20 @@ int QUICK_GROUP_MIN_MAX_SELECT::init()
if (group_prefix) /* Already initialized. */ if (group_prefix) /* Already initialized. */
return 0; return 0;
if (!(last_prefix= (uchar*) alloc_root(&alloc, group_prefix_len))) /*
We allocate one byte more to serve the case when the last field in
the buffer is compared using uint3korr (e.g. a Field_newdate field)
*/
if (!(last_prefix= (uchar*) alloc_root(&alloc, group_prefix_len+1)))
return 1; return 1;
/* /*
We may use group_prefix to store keys with all select fields, so allocate We may use group_prefix to store keys with all select fields, so allocate
enough space for it. enough space for it.
We allocate one byte more to serve the case when the last field in
the buffer is compared using uint3korr (e.g. a Field_newdate field)
*/ */
if (!(group_prefix= (uchar*) alloc_root(&alloc, if (!(group_prefix= (uchar*) alloc_root(&alloc,
real_prefix_len + min_max_arg_len))) real_prefix_len+min_max_arg_len+1)))
return 1; return 1;
if (key_infix_len > 0) if (key_infix_len > 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment