[MDEV-21809] Server crashes in Item_cond::get_mm_tree/prune_partitions Created: 2020-02-24 Updated: 2023-12-05 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Partitioning |
| Affects Version/s: | 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alice Sherepa | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Server crashes in Item_cond::get_mm_tree/prune_partitions
Reproducible with Myisam/Aria/Innodb, debug/non-debug, reproducible on 10.3-10.5:
|
| Comments |
| Comment by Igor Babaev [ 2020-06-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Assigned it Sergei Petrunia because the bug is definitely in his code. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-07-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Analysis:
The partition pruning module got this Item_cond_or from get_sargable_cond()
which also seems wrong, as the query is an inner join so on_expr should have been moved into WHERE. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-07-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
A bit more detail on how the ON expression is processed: Initially it is
simplify_joins moves it to the WHERE (to join->conds) then, the "0" is removed here:
this means the Item_cond_or becomes an "unary OR" and so execution reaches this point in Item_cond::remove_eq_conds :
(Note the empty() call. this is how the "0-way OR" is produced)
This all is ok | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-07-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Then, we reach here:
select_lex->leaf_tables has two elements.
One expects that tbl->table->pos_in_table_list==tbl but here it is a different TABLE_LIST object. Which also represents table t2! How is that possible? This second object was created here in multi_update::prepare here:
I am not sure what is its purpose. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Julien Fritsch [ 2023-12-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Automated message: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by JiraAutomate [ 2023-12-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Automated message: |