summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 48f58bc0e96..2cc7447202c 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -5283,6 +5283,7 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
if (!(*join_where)->fixed)
(*join_where)->fix_fields(join->thd, join_where);
}
+ table->table->maybe_null= test(join->mixed_implicit_grouping);
}
if ((nested_join= table->nested_join))
@@ -5313,9 +5314,9 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
through Item::cleanup() calls).
*/
-void cleanup_empty_jtbm_semi_joins(JOIN *join)
+void cleanup_empty_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list)
{
- List_iterator<TABLE_LIST> li(*join->join_list);
+ List_iterator<TABLE_LIST> li(*join_list);
TABLE_LIST *table;
while ((table= li++))
{
@@ -5327,6 +5328,10 @@ void cleanup_empty_jtbm_semi_joins(JOIN *join)
table->table= NULL;
}
}
+ else if (table->nested_join && table->sj_subq_pred)
+ {
+ cleanup_empty_jtbm_semi_joins(join, &table->nested_join->join_list);
+ }
}
}