diff options
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 4079298f6c0..e00083c4b8b 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5288,6 +5288,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= MY_TEST(join->mixed_implicit_grouping); } if ((nested_join= table->nested_join)) @@ -5318,9 +5319,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++)) { @@ -5332,6 +5333,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); + } } } |