[MDEV-8554] Server crashes in base_list_iterator::next_fast on 1st execution of PS with a multi-table update Created: 2015-07-28 Updated: 2019-06-25 Resolved: 2015-08-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | 5.5.45 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
|
| Comments |
| Comment by Sergei Petrunia [ 2015-07-30 ] | |||||||||||||||||||||||||||||
|
valgrind shows it's reading memory that was allocated on statement's execution MEM_ROOT:
| |||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-30 ] | |||||||||||||||||||||||||||||
|
Discussed with sanja. Rough idea of what happens:
For the subquery #2, select_lex->prep_leaf_list_state The query has thd->save_prep_leaf_list= FALSE, which UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM v3 );
This is done here: mysql_derived_merge:
and the value is never restored back.
Here, we attempt to use select_lex::leaf_tables and walk over freed memory. The first suspect is save_prep_leaf_list. Why does UPDATE change it and never puts it back? This looks like a bug. | |||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-30 ] | |||||||||||||||||||||||||||||
|
save_prep_leaf_list was introduced by 56eb6d7e69ecce856e2d54e2404157407cb7203b, Committer: Igor Babaev <igor@askmonty.org> Tue Jun 14 05:03:03 2011 Fixed LP bug #794890. | |||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-30 ] | |||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2015-July/008211.html |