[MDEV-7267] Server crashes in Item_field::print on ANALYZE FORMAT=JSON Created: 2014-12-04 Updated: 2015-10-06 Resolved: 2015-10-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | analyze-stmt, explain_json | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.1.8-3, 10.1.8-4 | ||||||||||||
| Description |
|
|
| Comments |
| Comment by Sergei Petrunia [ 2014-12-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
The query uses SJ-Materialization. The query plan is:
we crash when printing
and we crash because we free the temp_table before we try to print ANALYZE output. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-12-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
For most Items, it should be possible to call Item::print after execution structures (joins, temp.tables, etc) have been destroyed. However, some items are exceptional. Like in this example where an Item_field refers to a field of a temporary table.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-09-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
The problematic Item_field object is created here:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-09-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
A tentative patch: https://gist.github.com/spetrunia/cfb21f01ef3c462bdb64 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-09-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
psergey, FYI, during the last run, the same load was triggering 5 more known bugs, which are not 10.1-specific; so it's possible that the results will be cluttered with those, and we won't see ANALYZE/JSON-related issues. |