diff options
Diffstat (limited to 'sql/item_buff.cc')
-rw-r--r-- | sql/item_buff.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 2f45d0a17c2..0ac4edb3656 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -58,7 +58,9 @@ Cached_item::~Cached_item() {} */ Cached_item_str::Cached_item_str(THD *thd, Item *arg) - :item(arg), value(min(arg->max_length, thd->variables.max_sort_length)) + :item(arg), + value_max_length(min(arg->max_length, thd->variables.max_sort_length)), + value(value_max_length) {} bool Cached_item_str::cmp(void) @@ -67,7 +69,7 @@ bool Cached_item_str::cmp(void) bool tmp; if ((res=item->val_str(&tmp_value))) - res->length(min(res->length(), value.alloced_length())); + res->length(min(res->length(), value_max_length)); if (null_value != item->null_value) { if ((null_value= item->null_value)) |