summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-05-14 23:24:26 +0200
committerSergei Golubchik <serg@mariadb.org>2018-05-15 12:10:48 +0200
commit77cd754229ba74eb87518285f48e1d95d00fbde9 (patch)
treedb81f7d908c1efdcb87999d918508b024f69ed66 /sql/sql_table.cc
parentc29312421e9dd6b8b6be332788cbab0621cbcb9f (diff)
downloadmariadb-git-77cd754229ba74eb87518285f48e1d95d00fbde9.tar.gz
MDEV-16110 ALTER with ALGORITHM=INPLACE breaks temporary table with virtual columns
Part one, non-temporary tables. Rrenaming a column can make destructive changes to the TABLE. This TABLE cannot be used anymore and needs to be reopened even if ALTER TABLE was aborted with an error.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1ed2194b09a..b6d46ff82ab 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7677,6 +7677,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (field->default_value)
field->default_value->expr->walk(&Item::rename_fields_processor, 1,
&column_rename_param);
+ table->m_needs_reopen= 1; // because new column name is on thd->mem_root
}
/* Check if field is changed */