diff options
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 2c3cd0fe24e..a5088a012ae 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -65,7 +65,8 @@ TABLE *THD::create_and_open_tmp_table(handlerton *hton, const char *path, const char *db, const char *table_name, - bool open_in_engine) + bool open_in_engine, + bool open_internal_tables) { DBUG_ENTER("THD::create_and_open_tmp_table"); @@ -90,6 +91,15 @@ TABLE *THD::create_and_open_tmp_table(handlerton *hton, /* Free the TMP_TABLE_SHARE. */ free_tmp_table_share(share, false); + DBUG_RETURN(0); + } + + /* Open any related tables */ + if (open_internal_tables && table->internal_tables && + open_and_lock_internal_tables(table, open_in_engine)) + { + drop_temporary_table(table, NULL, false); + DBUG_RETURN(0); } } |