summaryrefslogtreecommitdiff
path: root/sql/sql_test.h
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2012-12-20 22:38:40 +0200
committerunknown <timour@askmonty.org>2012-12-20 22:38:40 +0200
commit1b2692d0e9f99d7cb2dbcdb8d030345679affbfc (patch)
treefb86b9311bdabba22f536d0a60ca8160f3f7c42f /sql/sql_test.h
parent35b60208359a8c67fa773e733927d16046b416c9 (diff)
downloadmariadb-git-1b2692d0e9f99d7cb2dbcdb8d030345679affbfc.tar.gz
MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
Analysys: In the beginning of JOIN::cleanup there is code that is supposed to free all filesort buffers. The code assumes that the table being sorted is the first non-constant table. To get this table it calls: first_top_level_tab(this, WITHOUT_CONST_TABLES) However, first_top_level_tab() instead returned the wrong table - the first one in the plan, instead of the first non-constant table. There is no other place outside filesort() where sort buffers may be freed. As a result, the sort buffer was not freed, and there was a memory leak. Solution: Change first_top_level_tab(), to test for WITH_CONST_TABLES instead of WITHOUT_CONST_TABLES.
Diffstat (limited to 'sql/sql_test.h')
0 files changed, 0 insertions, 0 deletions