1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

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.
This commit is contained in:
Alexander Nozdrin
2010-08-31 14:03:36 +04:00
parent 53e566a42a
commit d2159e37f2
4 changed files with 38 additions and 30 deletions

View File

@@ -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);