[MDEV-430] Server crashes in select_describe on EXPLAIN with materialization+semijoin, 2 nested subqueries, aggregate functions Created: 2012-08-03 Updated: 2012-08-28 Resolved: 2012-08-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.25 |
| Fix Version/s: | 5.5.27 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Note: It might belong to Timour, because the problem appeared with revno 3445 (
bzr version-info
Also reproducible on revno 3445. Not reproducible on revno 3444. Minimal optimizer_switch: Default optimizer_switch:
Test case:
|
| Comments |
| Comment by Sergei Petrunia [ 2012-08-04 ] |
|
The crash is caused by these sequence of actions: 1. The grand-child subquery is merged into the child subquery (as a JTBM semi-join) The stack trace of where the table is freed: |
| Comment by Sergei Petrunia [ 2012-08-04 ] |
|
Another thing: That is:
Something for Timour to look at. |
| Comment by Patryk Pomykalski [ 2012-08-05 ] |
|
I think the problem is JOIN::join_free doing full cleanup during explain (despite what the comment in the code says): === modified file 'sql/sql_select.cc'
|
| Comment by Timour Katchaounov (Inactive) [ 2012-08-06 ] |
|
The problem with expensive subquery evaluation during optimize (comment dated 2012-08-04 01:13) will be addressed by https://mariadb.atlassian.net/browse/MDEV-435. |
| Comment by Sergei Petrunia [ 2012-08-28 ] |
|
Patryk, agree with your suggestion. It's interesting that the comment above suggests there was a check for EXPLAIN in the past. timour@askmonty.org-20110704115116-cx7ibyty8uiwrpg7, Fix LP bug lp:802979
|
| Comment by Sergei Petrunia [ 2012-08-28 ] |
|
With the change, I am getting result differences like this: Debugging shows that "Using index" actually is the correct output. |
| Comment by Sergei Petrunia [ 2012-08-28 ] |
|
Ok, the wrong output was introduced by "CHEAP SQ" feature in May 2012. That feature caused a lot of changed EXPLAINs, and these slipped through. |
| Comment by Sergei Petrunia [ 2012-08-28 ] |
|
Fixed, pushed. |