summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 3f174029d48..7f7407fc2dc 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -998,7 +998,8 @@ static void make_sortkey(register Sort_param *param,
if (maybe_null)
*to++=1;
char *tmp_buffer= param->tmp_buffer ? param->tmp_buffer : (char*)to;
- String tmp(tmp_buffer, param->sort_length, cs);
+ String tmp(tmp_buffer, param->tmp_buffer ? param->sort_length :
+ sort_field->length, cs);
String *res= item->str_result(&tmp);
if (!res)
{