diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-08-31 14:03:36 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-08-31 14:03:36 +0400 |
commit | cc0925f5d95c9b77336b3f9cd307d7bc2236247e (patch) | |
tree | 51c4727108df919fd2a982c76f2d8294ed1199fa /sql/sql_table.cc | |
parent | 587f776cfe8cf70771cf0923199a25de710df6c4 (diff) | |
download | mariadb-git-cc0925f5d95c9b77336b3f9cd307d7bc2236247e.tar.gz |
Bug#27480 (Extend CREATE TEMPORARY TABLES privilege
to allow temp table operations) -- prerequisite patch #3.
Rename open_temporary_table() to open_table_uncached().
open_temporary_table() will be introduced in following patches
to open temporary tables for a statement.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 06db813481d..9d8f59189d0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -22,7 +22,7 @@ #include "sql_rename.h" // do_rename #include "sql_parse.h" // test_if_data_home_dir #include "sql_cache.h" // query_cache_* -#include "sql_base.h" // open_temporary_table, lock_table_names +#include "sql_base.h" // open_table_uncached, lock_table_names #include "lock.h" // wait_if_global_read_lock // start_waiting_global_read_lock, // mysql_unlock_tables @@ -4224,9 +4224,14 @@ bool mysql_create_table_no_lock(THD *thd, if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { - TABLE *table= NULL; - /* Open table and put in temporary table list */ - if (!(table= open_temporary_table(thd, path, db, table_name, 1))) + /* + Open a table (skipping table cache) and add it into + THD::temporary_tables list. + */ + + TABLE *table= open_table_uncached(thd, path, db, table_name, TRUE); + + if (!table) { (void) rm_temporary_table(create_info->db_type, path); goto err; @@ -6301,8 +6306,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, /* table is a normal table: Create temporary table in same directory */ build_table_filename(path, sizeof(path) - 1, new_db, tmp_name, "", FN_IS_TMP); - /* Open our intermediate table */ - new_table= open_temporary_table(thd, path, new_db, tmp_name, 1); + /* Open our intermediate table. */ + new_table= open_table_uncached(thd, path, new_db, tmp_name, TRUE); } if (!new_table) goto err_new_table_cleanup; @@ -6642,7 +6647,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, char path[FN_REFLEN]; TABLE *t_table; build_table_filename(path + 1, sizeof(path) - 1, new_db, table_name, "", 0); - t_table= open_temporary_table(thd, path, new_db, tmp_name, 0); + t_table= open_table_uncached(thd, path, new_db, tmp_name, FALSE); if (t_table) { intern_close_table(t_table); |