mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed
- add_ref_to_table_cond() should not just overwrite pre_idx_push_select_cond with the contents tab->select_cond. pre_idx_push_select_cond exists precisely for the reason that it may contain a condition that is a strict superset of what is in tab->select_cond. The fix is to inject generated equality into pre_idx_push_select_cond.
This commit is contained in:
@@ -19872,7 +19872,12 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
|
||||
error=(int) cond->add(join_tab->select->cond);
|
||||
join_tab->select->cond= cond;
|
||||
if (join_tab->select->pre_idx_push_select_cond)
|
||||
join_tab->select->pre_idx_push_select_cond= cond;
|
||||
{
|
||||
Item *new_cond= and_conds(join_tab->select->pre_idx_push_select_cond, cond);
|
||||
if (!new_cond->fixed && new_cond->fix_fields(thd, &new_cond))
|
||||
error= 1;
|
||||
join_tab->select->pre_idx_push_select_cond= new_cond;
|
||||
}
|
||||
join_tab->set_select_cond(cond, __LINE__);
|
||||
}
|
||||
else if ((join_tab->select= make_select(join_tab->table, 0, 0, cond, 0,
|
||||
|
Reference in New Issue
Block a user