mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/ram/work/b31249/b31249.5.0
into mysql.com:/home/ram/work/b31249/b31249.5.1
This commit is contained in:
@ -14370,13 +14370,31 @@ calc_group_buffer(JOIN *join,ORDER *group)
|
||||
group_item->decimals);
|
||||
break;
|
||||
case STRING_RESULT:
|
||||
{
|
||||
enum enum_field_types type= group_item->field_type();
|
||||
/*
|
||||
Group strings are taken as varstrings and require an length field.
|
||||
A field is not yet created by create_tmp_field()
|
||||
and the sizes should match up.
|
||||
As items represented as DATE/TIME fields in the group buffer
|
||||
have STRING_RESULT result type, we increase the length
|
||||
by 8 as maximum pack length of such fields.
|
||||
*/
|
||||
key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
|
||||
if (type == MYSQL_TYPE_TIME ||
|
||||
type == MYSQL_TYPE_DATE ||
|
||||
type == MYSQL_TYPE_DATETIME ||
|
||||
type == MYSQL_TYPE_TIMESTAMP)
|
||||
{
|
||||
key_length+= 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
Group strings are taken as varstrings and require an length field.
|
||||
A field is not yet created by create_tmp_field()
|
||||
and the sizes should match up.
|
||||
*/
|
||||
key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* This case should never be choosen */
|
||||
DBUG_ASSERT(0);
|
||||
|
Reference in New Issue
Block a user