1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
A bug in the restore_prev_nj_state function allowed interleaving 
inner tables of outer join operations with outer tables. With the
current implementation of the nested loops algorithm it could lead
to wrong result sets for queries with nested outer joins.
Another bug in this procedure effectively blocked evaluation of some
valid execution plans for queries with nested outer joins.
This commit is contained in:
igor@olga.mysql.com
2007-07-11 18:45:35 -07:00
parent 7cab171f64
commit 7f64144bf0
3 changed files with 233 additions and 2 deletions

View File

@ -8486,9 +8486,15 @@ static void restore_prev_nj_state(JOIN_TAB *last)
{
TABLE_LIST *last_emb= last->table->pos_in_table_list->embedding;
JOIN *join= last->join;
while (last_emb && !(--last_emb->nested_join->counter))
while (last_emb)
{
join->cur_embedding_map &= last_emb->nested_join->nj_map;
if (!(--last_emb->nested_join->counter))
join->cur_embedding_map&= ~last_emb->nested_join->nj_map;
else if (last_emb->nested_join->join_list.elements-1 ==
last_emb->nested_join->counter)
join->cur_embedding_map|= last_emb->nested_join->nj_map;
else
break;
last_emb= last_emb->embedding;
}
}