Skip to content

Commit 9a529de

Browse files
committed
Implement backup_finalize()
1 parent 11cc197 commit 9a529de

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

mysql-test/suite/backup/suite.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package My::Suite::Backup;
2+
3+
@ISA = qw(My::Suite);
4+
use My::Find;
5+
use File::Basename;
6+
use strict;
7+
8+
return "Not run for embedded server" if $::opt_embedded_server;
9+
10+
bless { };

sql/sql_backup.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ static my_bool backup_step(THD *thd, plugin_ref plugin, void *) noexcept
4646
return res != 0;
4747
}
4848

49+
static my_bool backup_finalize(THD *, plugin_ref plugin, void *) noexcept
50+
{
51+
handlerton *hton= plugin_hton(plugin);
52+
if (hton->backup_step)
53+
hton->backup_finalize();
54+
return 0;
55+
}
56+
4957
bool Sql_cmd_backup::execute(THD *thd)
5058
{
5159
if (check_global_access(thd, RELOAD_ACL) ||
@@ -68,6 +76,10 @@ bool Sql_cmd_backup::execute(THD *thd)
6876
plugin_foreach_with_mask(thd, backup_end, MYSQL_STORAGE_ENGINE_PLUGIN,
6977
PLUGIN_IS_DELETED|PLUGIN_IS_READY,
7078
reinterpret_cast<void*>(fail));
79+
80+
plugin_foreach_with_mask(thd, backup_finalize, MYSQL_STORAGE_ENGINE_PLUGIN,
81+
PLUGIN_IS_DELETED|PLUGIN_IS_READY, nullptr);
82+
7183
my_ok(thd);
7284
return false;
7385
}

0 commit comments

Comments
 (0)