summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-09 16:07:35 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-09 16:07:35 +0200
commit2d788ff5ca24d88853d3e201253a724392135f06 (patch)
treed7b3dd1b344b2dad4a8f9ead268e46574e82abfa /sql
parent4853c7192ded76ede690746cde9eaabbc448479b (diff)
downloadmariadb-git-2d788ff5ca24d88853d3e201253a724392135f06.tar.gz
test_sql_discovery storage engine
use it to test main test cases with need_full_discover_for_existence > 0
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc9
-rw-r--r--sql/sql_rename.cc13
-rw-r--r--sql/sql_rename.h3
-rw-r--r--sql/sql_table.cc1
4 files changed, 8 insertions, 18 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index f88a3ef05f9..15eab7f32df 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -713,15 +713,6 @@ end:
*/
share= (TABLE_SHARE*) 1;
}
- else
- {
- /*
- To be able perform any operation on table we should own
- some kind of metadata lock on it.
- */
- DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name,
- MDL_SHARED));
- }
mysql_mutex_unlock(&LOCK_open);
DBUG_RETURN(share);
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 2c75de6e8a6..c957076ac4f 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -32,6 +32,9 @@
static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list,
bool skip_error);
+static bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
+ char *new_table_name, char *new_table_alias,
+ bool skip_error);
static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list);
@@ -144,10 +147,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
MYSQL_OPEN_SKIP_TEMPORARY))
goto err;
- for (ren_table= table_list; ren_table; ren_table= ren_table->next_local)
- tdc_remove_table(thd, TDC_RT_REMOVE_ALL, ren_table->db,
- ren_table->table_name, FALSE);
-
error=0;
/*
An exclusive lock on table names is satisfactory to ensure
@@ -235,7 +234,7 @@ static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list)
true rename failed
*/
-bool
+static bool
do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
char *new_table_alias, bool skip_error)
{
@@ -269,6 +268,10 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
if (old_exists)
{
+ DBUG_ASSERT(!thd->locked_tables_mode);
+ tdc_remove_table(thd, TDC_RT_REMOVE_ALL,
+ ren_table->db, ren_table->table_name, false);
+
if (hton != view_pseudo_hton)
{
if (!(rc= mysql_rename_table(hton, ren_table->db, old_alias,
diff --git a/sql/sql_rename.h b/sql/sql_rename.h
index 039a3b8b4a1..aaf09a8d030 100644
--- a/sql/sql_rename.h
+++ b/sql/sql_rename.h
@@ -20,8 +20,5 @@ class THD;
struct TABLE_LIST;
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent);
-bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
- char *new_table_name, char *new_table_alias,
- bool skip_error);
#endif /* SQL_RENAME_INCLUDED */
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 0a02e674c07..8f2320b9b30 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -22,7 +22,6 @@
#include "unireg.h"
#include "debug_sync.h"
#include "sql_table.h"
-#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_table_uncached, lock_table_names