diff options
author | unknown <ingo@mysql.com> | 2004-12-16 11:41:52 +0100 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2004-12-16 11:41:52 +0100 |
commit | 9a2c0bd93212f08dfb1d04367df850d38006f176 (patch) | |
tree | 3e9e553a8f21b5e0d73179dff22efae24126932c /sql | |
parent | 7845f99abf1d36e972970c0fc9431956a8f4b63a (diff) | |
download | mariadb-git-9a2c0bd93212f08dfb1d04367df850d38006f176.tar.gz |
Enlarged group item key_length by a varstring length field.
Group item fields are implemented as varstrings nowadays.
Made init_connect.test robust against existing t1.
mysql-test/r/init_connect.result:
Made init_connect.test robust against existing t1.
mysql-test/t/init_connect.test:
Made init_connect.test robust against existing t1.
sql/sql_select.cc:
Enlarged group item key_length by a varstring length field.
Group item fields are implemented as varstrings nowadays.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ed3606856a0..13f556efa16 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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++; |