mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-28871: Assert ... failed in JOIN::dbug_verify_sj_inner_tables...
optimize_semi_joins() calls update_sj_state() to update semi-join optimization state in the JOIN class. greedy_search() algorithm considers different join prefixes, and then picks one table to put into the join prefix. Most of the semi-join optimization state is in the table's entry in the join->positions[cur_prefix_size]. However, it also needs to call update_sj_state() to update the semi-join optimization state in the JOIN class. There is one exception, which is the cause of this bug: when we're inside optimize_semi_join_nests() and are optimizing a subquery, optimize_semi_joins() does nothing, it doesn't call update_sj_state(). greedy_search() must not do that either.
This commit is contained in:
@@ -2894,6 +2894,7 @@ void optimize_semi_joins(JOIN *join, table_map remaining_tables, uint idx,
|
||||
void update_sj_state(JOIN *join, const JOIN_TAB *new_tab,
|
||||
uint idx, table_map remaining_tables)
|
||||
{
|
||||
DBUG_ASSERT(!join->emb_sjm_nest);
|
||||
if (TABLE_LIST *emb_sj_nest= new_tab->emb_sj_nest)
|
||||
{
|
||||
join->cur_sj_inner_tables |= emb_sj_nest->sj_inner_tables;
|
||||
|
Reference in New Issue
Block a user