mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
PT-2389 Fix unconditional ALTER on new table with resume
When running with --resume option the ALTER runs on the new table even if the new table exists and has already been altered. This causes a deterministic failure every time the --resume option is used. This fix tests if --resume is given and does not run ALTER on the new table. If pt-osc did not successfully alter the new table during the previous invocation, this could cause the ALTER to not be applied. The right fix would be to compare the DDL of the _new table to the proposed DDL generated by pt-osc and only run ALTER if they do not match.
This commit is contained in:
@@ -9912,7 +9912,7 @@ sub main {
|
||||
);
|
||||
}
|
||||
|
||||
if ( my $alter = $o->get('alter') ) {
|
||||
if ( (my $alter = $o->get('alter')) && !$o->get('resume') ) {
|
||||
print "Altering new table...\n";
|
||||
my $sql = "ALTER TABLE $new_tbl->{name} $alter";
|
||||
print $sql, "\n" if $o->get('print');
|
||||
|
Reference in New Issue
Block a user