summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2022-04-04 12:32:22 +0300
committerSergei Petrunia <sergey@mariadb.com>2022-04-29 10:48:26 +0300
commit3f68c2169e16814e8e268d0f9a9f29aee522453e (patch)
treec510410cc65f3943c4ed69fd7e93ee9804cc9cb5 /sql/sql_base.h
parent02c3babdec0c931c6983863bff129114f750bd22 (diff)
downloadmariadb-git-3f68c2169e16814e8e268d0f9a9f29aee522453e.tar.gz
MDEV-28201: Server crashes upon SHOW ANALYZE/EXPLAIN FORMAT=JSON
- Describe the lifetime of EXPLAIN data structures in sql_explain.h:ExplainDataStructureLifetime. - Make Item_field::set_field() call set_refers_to_temp_table() when it refers to a temp. table. - Introduce QT_DONT_ACCESS_TMP_TABLES flag for Item::print. It directs Item_field::print to not try access its the temp table. - Introduce Explain_query::notify_tables_are_closed() and call it right before the query closes its tables. - Make Explain data stuctures' print_explain_json() methods accept "no_tmp_tbl" parameter which means pass QT_DONT_ACCESS_TMP_TABLES when printing items. - Make Show_explain_request::call_in_target_thread() not call set_current_thd(). This wasn't needed as the code inside lex->print_explain() uses output->thd anyway. output->thd refers to the SHOW command's THD object.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 5b449fdddac..c593d85b5e7 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -161,6 +161,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
const LEX_CSTRING *db_name,
const LEX_CSTRING *table_name);
int close_thread_tables(THD *thd);
+int close_thread_tables_for_query(THD *thd);
void switch_to_nullable_trigger_fields(List<Item> &items, TABLE *);
void switch_defaults_to_nullable_trigger_fields(TABLE *table);
bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,