1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-12 12:25:37 +03:00

Added backup handler calls

Part of MDEV-5336 Implement LOCK FOR BACKUP

Added support for backup calls in Aria to protect
removal of redo logs.
This commit is contained in:
Monty
2018-10-06 16:49:54 +03:00
parent ecdf97924c
commit 1077f320e4
5 changed files with 89 additions and 2 deletions

View File

@@ -822,6 +822,43 @@ void ha_kill_query(THD* thd, enum thd_kill_levels level)
}
/*****************************************************************************
Backup functions
******************************************************************************/
static my_bool plugin_prepare_for_backup(THD *unused1, plugin_ref plugin,
void *not_used)
{
handlerton *hton= plugin_hton(plugin);
if (hton->state == SHOW_OPTION_YES && hton->prepare_for_backup)
hton->prepare_for_backup();
return FALSE;
}
void ha_prepare_for_backup()
{
plugin_foreach_with_mask(0, plugin_prepare_for_backup,
MYSQL_STORAGE_ENGINE_PLUGIN,
PLUGIN_IS_DELETED|PLUGIN_IS_READY, 0);
}
static my_bool plugin_end_backup(THD *unused1, plugin_ref plugin,
void *not_used)
{
handlerton *hton= plugin_hton(plugin);
if (hton->state == SHOW_OPTION_YES && hton->end_backup)
hton->end_backup();
return FALSE;
}
void ha_end_backup()
{
plugin_foreach_with_mask(0, plugin_end_backup,
MYSQL_STORAGE_ENGINE_PLUGIN,
PLUGIN_IS_DELETED|PLUGIN_IS_READY, 0);
}
/* ========================================================================
======================= TRANSACTIONS ===================================*/