diff options
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 80a80363cc0..c8b5a3439b0 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3472,18 +3472,24 @@ void SELECT_LEX::update_used_tables() List_iterator<TABLE_LIST> ti(leaf_tables); while ((tl= ti++)) { - for (embedding= tl; - !tl->table->maybe_null && embedding; - embedding= embedding->embedding) + TABLE_LIST *embedding; + embedding= tl; + do { - tl->table->maybe_null= test(embedding->outer_join); + bool maybe_null; + if ((maybe_null= test(embedding->outer_join))) + { + tl->table->maybe_null= maybe_null; + break; + } } + while ((embedding= embedding->embedding)); if (tl->on_expr) { tl->on_expr->update_used_tables(); tl->on_expr->walk(&Item::eval_not_null_tables, 0, NULL); } - TABLE_LIST *embedding= tl->embedding; + embedding= tl->embedding; while (embedding) { if (embedding->on_expr && |