diff options
Diffstat (limited to 'sql/sql_tvc.cc')
-rw-r--r-- | sql/sql_tvc.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index 7b4a9596afd..56a6ae58a77 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -283,6 +283,9 @@ int table_value_constr::save_explain_data_intern(THD *thd, explain= new (output->mem_root) Explain_select(output->mem_root, thd->lex->analyze_stmt); + if (!explain) + DBUG_RETURN(1); + select_lex->set_explain_type(true); explain->select_id= select_lex->select_number; @@ -309,7 +312,7 @@ int table_value_constr::save_explain_data_intern(THD *thd, Optimization of TVC */ -void table_value_constr::optimize(THD *thd) +bool table_value_constr::optimize(THD *thd) { create_explain_query_if_not_exists(thd->lex, thd->mem_root); have_query_plan= QEP_AVAILABLE; @@ -320,8 +323,9 @@ void table_value_constr::optimize(THD *thd) thd->lex->explain && // for "SET" command in SPs. (!thd->lex->explain->get_select(select_lex->select_number))) { - save_explain_data_intern(thd, thd->lex->explain); + return save_explain_data_intern(thd, thd->lex->explain); } + return 0; } |