summaryrefslogtreecommitdiff
path: root/sql/sql_partition_admin.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-12-17 16:25:15 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-04-03 13:01:21 +0400
commit7a947614fbf8b925ae3df70ec8df80c745eafd4c (patch)
treed462b7218559c2e7855a6019ffc382f003f1f889 /sql/sql_partition_admin.cc
parent06fae75859821fe36f68eb2d77f007f014143282 (diff)
downloadmariadb-git-7a947614fbf8b925ae3df70ec8df80c745eafd4c.tar.gz
Split tdc_remove_table()
TDC_RT_REMOVE_ALL -> tdc_remove_table(). Some occurrences replaced with TDC_element::flush() (whenver TABLE_SHARE is available). TDC_RT_REMOVE_NOT_OWN[_KEEP_SHARE] -> TDC_element::flush(). These modes assume that current thread owns TABLE_SHARE reference, which means we can avoid hash lookup and flush unused TABLE instances directly. TDC_RT_REMOVE_UNUSED -> TDC_element::flush_unused(). Only [ab]used by mysql_admin_table() currently. Should be removed eventually. Part of MDEV-17882 - Cleanup refresh version
Diffstat (limited to 'sql/sql_partition_admin.cc')
-rw-r--r--sql/sql_partition_admin.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 92ac1b2ce4c..ed77c0938f3 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -825,8 +825,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
if (thd->mdl_context.upgrade_shared_lock(ticket, MDL_EXCLUSIVE, timeout))
DBUG_RETURN(TRUE);
- tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN, first_table->db.str,
- first_table->table_name.str);
+ first_table->table->s->tdc->flush(thd, true);
partition= (ha_partition*) first_table->table->file;
/* Invoke the handler method responsible for truncating the partition. */