summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index fd6d0e44597..3bde5aa8f6a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7173,14 +7173,14 @@ void JOIN::cleanup(bool full)
{
JOIN_TAB *tab,*end;
/*
- Only a sorted table may be cached. This sorted table is always the
- first non const table in join->all_tables
+ Free resources allocated by filesort() and Unique::get()
*/
if (tables > const_tables) // Test for not-const tables
- {
- free_io_cache(all_tables[const_tables]);
- filesort_free_buffers(all_tables[const_tables],full);
- }
+ for (uint ix= const_tables; ix < tables; ++ix)
+ {
+ free_io_cache(all_tables[ix]);
+ filesort_free_buffers(all_tables[ix], full);
+ }
if (full)
{