summaryrefslogtreecommitdiff
path: root/sql/sql_rename.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-05-22 14:36:06 +0300
committerMonty <monty@mariadb.org>2018-05-22 23:05:48 +0300
commitda71c1bad79ee11009b3b28a2a745709e04020cf (patch)
tree7b0410b8d6a8dd724d604da1390d67bac09f1309 /sql/sql_rename.cc
parent2f3779d31cbbabcb171c22237253c82146118446 (diff)
downloadmariadb-git-da71c1bad79ee11009b3b28a2a745709e04020cf.tar.gz
MDEV-16229 Replication aborts with ER_VIEW_SELECT_TMPTABLE after half-failed RENAME
Problem was that detection of temporary tables was all wrong for RENAME TABLE. (Temporary tables where opened by top level call to open_temporary_tables(), which can't detect if a temporary table was renamed to something and then reused). Fixed by adding proper parsing of rename list to check against the current name of a table at each rename stage. Also change do_rename_temporary() to check against the current state of temporary tables, not according to the state of start of RENAME TABLE.
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r--sql/sql_rename.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 1a9cb842e6a..119f9063724 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -222,7 +222,7 @@ do_rename_temporary(THD *thd, TABLE_LIST *ren_table, TABLE_LIST *new_table,
new_alias= (lower_case_table_names == 2) ? new_table->alias :
new_table->table_name;
- if (is_temporary_table(new_table))
+ if (find_temporary_table(thd, new_table))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
DBUG_RETURN(1); // This can't be skipped