summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2021-03-30 17:06:55 +0300
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:54:13 +0200
commit83e529eced51aa965805e894349bbadd26881f3f (patch)
tree2f13b79cf5648498ee709424ea37105be730fcf3 /sql/ha_partition.cc
parent496a14e18714ac3f0b686ec5f57bf88e96512d2f (diff)
downloadmariadb-git-83e529eced51aa965805e894349bbadd26881f3f.tar.gz
MDEV-18465 Logging of DDL statements during backup
Many of the changes was needed to be able to collect and print engine name and table version id's in the ddl log.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index f252c0c3137..dd9fea5937a 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -459,6 +459,11 @@ void ha_partition::init_handler_variables()
#endif
}
+const char *ha_partition::real_table_type() const
+{
+ // we can do this since we only support a single engine type
+ return m_file[0]->table_type();
+}
/*
Destructor method
@@ -3772,6 +3777,15 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
*/
clear_handler_file();
+ DBUG_ASSERT(part_share);
+ lock_shared_ha_data();
+ /* Protect against cloned file, for which we don't need engine name */
+ if (m_file[0])
+ part_share->partition_engine_name= real_table_type();
+ else
+ part_share->partition_engine_name= 0; // Checked in ha_table_exists()
+ unlock_shared_ha_data();
+
/*
Some handlers update statistics as part of the open call. This will in
some cases corrupt the statistics of the partition handler and thus