summaryrefslogtreecommitdiff
path: root/sql/temporary_tables.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-02-06 11:41:36 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-04-03 16:47:25 +0400
commit1dac55cf0ef4a412d56ea870835e1e199a400820 (patch)
treeb6c24683247c7657fd24592e110d6639da9f050d /sql/temporary_tables.cc
parent3638636f9b0c07665c5df498c31ae9c6ccac0b34 (diff)
downloadmariadb-git-1dac55cf0ef4a412d56ea870835e1e199a400820.tar.gz
Removed redundant SE lock for tmp tables
CREATE TEMPORARY TABLE locks SE plugin 6 times. 5 of these locks are released by the end of the statement. And only 1 acquired by init_from_binary_frm_image() / plugin_lock() remains. The lock removed in this patch was clearly redundant. Part of MDEV-17805 - Remove InnoDB cache for temporary tables.
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r--sql/temporary_tables.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index 9cdae7d1885..c5b709f4ec1 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -49,7 +49,6 @@ bool THD::has_thd_temporary_tables()
/**
Create a temporary table, open it and return the TABLE handle.
- @param hton [IN] Handlerton
@param frm [IN] Binary frm image
@param path [IN] File path (without extension)
@param db [IN] Schema name
@@ -60,8 +59,7 @@ bool THD::has_thd_temporary_tables()
@return Success A pointer to table object
Failure NULL
*/
-TABLE *THD::create_and_open_tmp_table(handlerton *hton,
- LEX_CUSTRING *frm,
+TABLE *THD::create_and_open_tmp_table(LEX_CUSTRING *frm,
const char *path,
const char *db,
const char *table_name,
@@ -73,7 +71,7 @@ TABLE *THD::create_and_open_tmp_table(handlerton *hton,
TMP_TABLE_SHARE *share;
TABLE *table= NULL;
- if ((share= create_temporary_table(hton, frm, path, db, table_name)))
+ if ((share= create_temporary_table(frm, path, db, table_name)))
{
open_options|= HA_OPEN_FOR_CREATE;
table= open_temporary_table(share, table_name, open_in_engine);
@@ -905,7 +903,6 @@ uint THD::create_tmp_table_def_key(char *key, const char *db,
/**
Create a temporary table.
- @param hton [IN] Handlerton
@param frm [IN] Binary frm image
@param path [IN] File path (without extension)
@param db [IN] Schema name
@@ -914,8 +911,7 @@ uint THD::create_tmp_table_def_key(char *key, const char *db,
@return Success A pointer to table share object
Failure NULL
*/
-TMP_TABLE_SHARE *THD::create_temporary_table(handlerton *hton,
- LEX_CUSTRING *frm,
+TMP_TABLE_SHARE *THD::create_temporary_table(LEX_CUSTRING *frm,
const char *path,
const char *db,
const char *table_name)
@@ -953,8 +949,6 @@ TMP_TABLE_SHARE *THD::create_temporary_table(handlerton *hton,
init_tmp_table_share(this, share, saved_key_cache, key_length,
strend(saved_key_cache) + 1, tmp_path);
- share->db_plugin= ha_lock_engine(this, hton);
-
/*
Prefer using frm image over file. The image might not be available in
ALTER TABLE, when the discovering engine took over the ownership (see