summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-23 16:41:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-23 16:41:34 +0300
commit8c80a66e047ba149bff03f42a1adcb2c9315135d (patch)
tree1e058ed6ffdf07d7846d8f74c4e640da21fbbc4f /sql/handler.cc
parent61c0df94655f2dc3146456e49f3f51610251e79f (diff)
downloadmariadb-git-bb-10.3-marko.tar.gz
MDEV-22351 RESET MASTER should be propagated to InnoDBbb-10.3-marko
Ever since commit 947efe17ed8188ca4feef6deb0c2831a246b5c8f InnoDB no longer writes binlog position in one place. It will not at all be written to the TRX_SYS page, and instead it will be written to the undo log header page that changes the transaction state. ha_reset_master(), trx_rseg_reset_binlog_pos(): Reset the binlog information in InnoDB when RESET MASTER is invoked. reset_master(): Invoke ha_reset_master() to discard the information in InnoDB.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 6bd8938fdca..e6adb4fdd93 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, MariaDB Corporation.
+ Copyright (c) 2009, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -747,6 +747,22 @@ void ha_drop_database(char* path)
}
+static my_bool reset_master_handlerton(THD *, plugin_ref plugin, void *)
+{
+ handlerton *hton= plugin_hton(plugin);
+ if (hton->reset_master)
+ hton->reset_master();
+ return FALSE;
+}
+
+
+void ha_reset_master()
+{
+ plugin_foreach(NULL, reset_master_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN,
+ NULL);
+}
+
+
static my_bool checkpoint_state_handlerton(THD *unused1, plugin_ref plugin,
void *disable)
{