summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2008-01-10 19:23:36 +0300
committerunknown <evgen@moonbone.local>2008-01-10 19:23:36 +0300
commiteb80c468c0ee8f5363fae0f4cc544c53b4208367 (patch)
tree53e6b88d687d08c80722360bd6c444394d52f32e
parentdafd3f439cf40ae17ba4225738413e74155f7997 (diff)
parent1a8bcceb2d829f868421472995e65b66655d5d33 (diff)
downloadmariadb-git-eb80c468c0ee8f5363fae0f4cc544c53b4208367.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/work/33675-bug-5.0-opt-mysql
-rw-r--r--sql/filesort.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 5a8e3627758..43b079e83d5 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -239,10 +239,14 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
else
{
+ if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
+ {
+ x_free(table_sort.buffpek);
+ table_sort.buffpek= 0;
+ }
if (!(table_sort.buffpek=
read_buffpek_from_file(&buffpek_pointers, maxbuffer,
- (table_sort.buffpek_len < maxbuffer ?
- NULL : table_sort.buffpek))))
+ table_sort.buffpek)))
goto err;
buffpek= (BUFFPEK *) table_sort.buffpek;
table_sort.buffpek_len= maxbuffer;