[MDEV-5582] Plugin 'MEMORY' has ref_count=1 after shutdown with materialization+semijoin Created: 2014-01-28 Updated: 2014-02-07 Resolved: 2014-02-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.3.12, 5.5.35, 10.0.7 |
| Fix Version/s: | 5.5.36, 10.0.9, 5.3.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Description |
|
In 5.3 and 5.5, it produces the error on shutdown:
In 10.0, it causes assertion failure:
Stack trace from:
|
| Comments |
| Comment by Sergei Petrunia [ 2014-02-07 ] | ||||||||||||||||||||||||||||||
|
The leak is because materialization table for non-merged semi-join is created and not freed. The query plan is:
-----
----- | ||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-02-07 ] | ||||||||||||||||||||||||||||||
|
The following happens: > JOIN::optimize() convert_join_subqueries_to_semijoins()
setup_jtbm_semi_joins()
constant table code finds that non-merged semi-join is an empty <JOIN::optimize() >JOIN::cleanup(full=true) ^^ the branch is not taken, bevause JOIN::table=NULL (and As a consequence, the temp.table is never freed. | ||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-02-07 ] | ||||||||||||||||||||||||||||||
|
Upon closer examination: JOIN::cleanup( full=true) actually does call cleanup_empty_jtbm_semi_joins(JOIN *join). The problem is that that function doesn't recurse down into semi-join nests. |