diff options
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 24305ec194f..a65f53a86c2 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4936,7 +4936,6 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list, bool JOIN::choose_subquery_plan(table_map join_tables) { - Join_plan_state save_qep; /* The original QEP of the subquery. */ enum_reopt_result reopt_result= REOPT_NONE; Item_in_subselect *in_subs; @@ -4955,12 +4954,15 @@ bool JOIN::choose_subquery_plan(table_map join_tables) } else return false; + /* A strategy must be chosen earlier. */ DBUG_ASSERT(in_subs->has_strategy()); DBUG_ASSERT(in_to_exists_where || in_to_exists_having); DBUG_ASSERT(!in_to_exists_where || in_to_exists_where->fixed); DBUG_ASSERT(!in_to_exists_having || in_to_exists_having->fixed); + Join_plan_state save_qep; /* The original QEP of the subquery. */ + /* Compute and compare the costs of materialization and in-exists if both strategies are possible and allowed by the user (checked during the prepare |