Commit 48e1cea3 authored by unknown's avatar unknown

Merge mysql.com:/home/mydev/mysql-5.0

into mysql.com:/home/mydev/mysql-5.0-wl2126

parents eaec00b1 9a2c0bd9
......@@ -12,7 +12,7 @@ set GLOBAL init_connect=DEFAULT;
select @a;
@a
NULL
set global init_connect="create table t1(a char(10));\
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
select hex(a) from t1;
hex(a)
......
......@@ -19,7 +19,7 @@ connect (con3,localhost,user_1,,);
connection con3;
select @a;
connection con0;
set global init_connect="create table t1(a char(10));\
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
connect (con4,localhost,user_1,,);
connection con4;
......
......@@ -11654,8 +11654,21 @@ calc_group_buffer(JOIN *join,ORDER *group)
key_length+=sizeof(double);
else if ((*group->item)->result_type() == INT_RESULT)
key_length+=sizeof(longlong);
else if ((*group->item)->result_type() == STRING_RESULT)
{
/*
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;
}
else
key_length+=(*group->item)->max_length;
{
/* This case should never be choosen */
DBUG_ASSERT(0);
current_thd->fatal_error();
}
parts++;
if ((*group->item)->maybe_null)
null_parts++;
......
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