summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorigor@olga.mysql.com <>2007-07-11 21:05:09 -0700
committerigor@olga.mysql.com <>2007-07-11 21:05:09 -0700
commit5fea580f074233175be4c0844b6690fc9ac5a4f3 (patch)
treee4dda66e53c1f1306df72cf3f27574aa96c3492a /sql
parentb7bb96dd5a86e3727443411644669fd5d51944c2 (diff)
parent7f64144bf0a2bb0ec7ada60685993a1c9bba80c1 (diff)
downloadmariadb-git-5fea580f074233175be4c0844b6690fc9ac5a4f3.tar.gz
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29604
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9d27ab4bb4e..c62a19b2752 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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;
}
}