diff options
author | Michael Widenius <monty@mariadb.org> | 2017-11-14 07:47:58 +0200 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2017-11-17 07:30:05 +0200 |
commit | 87933d52619c3f0df84922e23d5a8b03fa050133 (patch) | |
tree | 6e495d5f9bf731b055a4d7a582fa092d19c5929f /sql/sql_tvc.cc | |
parent | 31bd86c8df63a4d9e98d67541e136456bd6d9cc2 (diff) | |
download | mariadb-git-87933d52619c3f0df84922e23d5a8b03fa050133.tar.gz |
Handle failures from malloc
Most "new" failures fixed in the following files:
- sql_select.cc
- item.cc
- item_func.cc
- opt_subselect.cc
Other things:
- Allocate udf_handler strings in mem_root
- Required changes in sql_string.h
- Add mem_root as argument to some new [] calls
- Mark udf_handler strings as thread specific
- Removed some comment blocks with code
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 8c8e132746e..79e894f5a7f 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; } |