3016
3016
case REAL_RESULT:
3017
3017
key_length+= sizeof(double);
3019
3020
case INT_RESULT:
3020
3021
key_length+= sizeof(int64_t);
3022
3024
case DECIMAL_RESULT:
3023
3025
key_length+= my_decimal_get_binary_size(group_item->max_length -
3024
3026
(group_item->decimals ? 1 : 0),
3025
3027
group_item->decimals);
3027
3030
case STRING_RESULT:
3029
enum enum_field_types type= group_item->field_type();
3031
As items represented as DATE/TIME fields in the group buffer
3032
have STRING_RESULT result type, we increase the length
3033
by 8 as maximum pack length of such fields.
3035
if (type == DRIZZLE_TYPE_DATE ||
3036
type == DRIZZLE_TYPE_DATETIME ||
3037
type == DRIZZLE_TYPE_TIMESTAMP)
3032
enum enum_field_types type= group_item->field_type();
3044
Group strings are taken as varstrings and require an length field.
3045
A field is not yet created by create_tmp_field()
3046
and the sizes should match up.
3034
As items represented as DATE/TIME fields in the group buffer
3035
have STRING_RESULT result type, we increase the length
3036
by 8 as maximum pack length of such fields.
3048
key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
3038
if (type == DRIZZLE_TYPE_DATE ||
3039
type == DRIZZLE_TYPE_DATETIME ||
3040
type == DRIZZLE_TYPE_TIMESTAMP)
3047
Group strings are taken as varstrings and require an length field.
3048
A field is not yet created by create_tmp_field()
3049
and the sizes should match up.
3051
key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
3053
3057
/* This case should never be choosen */
3055
3059
my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
3059
3065
if (group_item->maybe_null)
3062
3069
join->tmp_table_param.group_length=key_length+null_parts;
3063
3070
join->tmp_table_param.group_parts=parts;
3064
3071
join->tmp_table_param.group_null_parts=null_parts;