diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-29 17:34:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-29 17:34:49 +0300 |
commit | a3539bbb2ac51dfa2b363d3b4c11784c25d1f256 (patch) | |
tree | 6b49da1f15e5740adaf5da1c4179760a15b77dc4 /sql/temporary_tables.cc | |
parent | c98e6d4b3d4d17ee429c696ac07e0bc4bbe1a81e (diff) | |
parent | 6f96ff7268dd20d6d3b61931c972e7a43c1efdff (diff) | |
download | mariadb-git-a3539bbb2ac51dfa2b363d3b4c11784c25d1f256.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 54ce3b61f79..f23ec7a1acc 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -112,12 +112,14 @@ TABLE *THD::create_and_open_tmp_table(handlerton *hton, @param db [IN] Database name @param table_name [IN] Table name + @param state [IN] State of temp table to open @return Success Pointer to first used table instance. Failure NULL */ TABLE *THD::find_temporary_table(const char *db, - const char *table_name) + const char *table_name, + Temporary_table_state state) { DBUG_ENTER("THD::find_temporary_table"); @@ -134,7 +136,7 @@ TABLE *THD::find_temporary_table(const char *db, key_length= create_tmp_table_def_key(key, db, table_name); locked= lock_temporary_tables(); - table = find_temporary_table(key, key_length, TMP_TABLE_IN_USE); + table= find_temporary_table(key, key_length, state); if (locked) { DBUG_ASSERT(m_tmp_tables_locked); @@ -153,16 +155,12 @@ TABLE *THD::find_temporary_table(const char *db, @return Success Pointer to first used table instance. Failure NULL */ -TABLE *THD::find_temporary_table(const TABLE_LIST *tl) +TABLE *THD::find_temporary_table(const TABLE_LIST *tl, + Temporary_table_state state) { DBUG_ENTER("THD::find_temporary_table"); - - if (!has_temporary_tables()) - { - DBUG_RETURN(NULL); - } - - TABLE *table= find_temporary_table(tl->get_db_name(), tl->get_table_name()); + TABLE *table= find_temporary_table(tl->get_db_name(), tl->get_table_name(), + state); DBUG_RETURN(table); } |