1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-11162 Assertion `num_records == m_idx_array.size()' failed in Filesort_buffer::alloc_sort_buffer(uint, uint)

When JOIN::destroy() is called for a JOIN object that has
   - join->tmp_join != NULL
   - also has join->table[0]->sort

then the latter was not cleaned up.
This could cause a memory leak and/or asserts in the subsequent queries.

Fixed by adding a cleanup call.
This commit is contained in:
Varun Gupta
2016-12-07 23:44:52 +05:30
parent c32d3e16f3
commit 822fb79799
3 changed files with 18 additions and 0 deletions

View File

@ -3144,6 +3144,7 @@ JOIN::destroy()
*/
tmp_table_param.cleanup();
tmp_join->tmp_table_param.copy_field= 0;
cleanup(1);
DBUG_RETURN(tmp_join->destroy());
}
cond_equal= 0;