summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2012-09-18 17:32:02 +0200
committerTor Didriksen <tor.didriksen@oracle.com>2012-09-18 17:32:02 +0200
commitb04427802069576e3ab7180c5565d50d9698d98a (patch)
tree2a6b26202a60f99e2c4316ffd53539df5cae2b3a /sql/opt_range.cc
parent9f11f46526956ebcb5c0883852233279a987b90a (diff)
downloadmariadb-git-b04427802069576e3ab7180c5565d50d9698d98a.tar.gz
Bug#14542543 FIX BUG #12694872 IN 5.5
Bug#14530242 CRASH / MEMORY CORRUPTION IN FILESORT_BUFFER::GET_RECORD_BUFFER WITH MYISAM This is a backport of Bug#12694872 - VALGRIND: 18,816 BYTES IN 196 BLOCKS ARE DEFINITELY LOST Bug#13340270: assertion table->sort.record_pointers == __null Bug#14536113 CRASH IN CLOSEFRM (TABLE.CC) OR UNPACK (FIELD.H) ON SUBQUERY WITH MYISAM TABLES Also: removed and re-added test files with file-ids from trunk.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 8d221af392b..ce48a8da958 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -74,6 +74,7 @@
#include "records.h" // init_read_record, end_read_record
#include <m_ctype.h>
#include "sql_select.h"
+#include "filesort.h" // filesort_free_buffers
#ifndef EXTRA_DEBUG
#define test_rb_tree(A,B) {}
@@ -1246,7 +1247,8 @@ int QUICK_INDEX_MERGE_SELECT::init()
int QUICK_INDEX_MERGE_SELECT::reset()
{
DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::reset");
- DBUG_RETURN(read_keys_and_merge());
+ const int retval= read_keys_and_merge();
+ DBUG_RETURN(retval);
}
bool
@@ -8295,7 +8297,10 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
thd->variables.sortbuff_size);
}
else
+ {
unique->reset();
+ filesort_free_buffers(head, false);
+ }
DBUG_ASSERT(file->ref_length == unique->get_size());
DBUG_ASSERT(thd->variables.sortbuff_size == unique->get_max_in_memory_size());