PT-132 pt-online-schema-change should imply --no-drop-new-table when --no-swap-tables and --no-drop-triggers used

This commit is contained in:
Carlos Salguero
2017-05-05 12:55:23 -03:00
parent 4c7ad1b3d0
commit e32488d592
2 changed files with 23 additions and 2 deletions

View File

@@ -68,6 +68,27 @@ is_deeply(
"no swap-tables, drop-triggers, drop-new-table: tables"
) or diag(Dumper($tables), $output);
# #############################################################################
# --no-swap-tables --no-drop-triggers implies --no-drop-new-table
# #############################################################################
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
$output = output(
sub { pt_online_schema_change::main(
"$master_dsn,D=pt_osc,t=t",
'--alter', 'ADD COLUMN d INT',
qw(--execute --no-swap-tables --no-drop-triggers))
},
stderr => 1,
);
$tables = $dbh1->selectall_arrayref("SHOW TABLES FROM pt_osc");
is_deeply(
$tables,
[ ['_t_new'], ['t'] ],
"no swap-tables, --no-drop-triggers implies --no-drop-new-table"
) or diag(Dumper($tables), $output);
# #############################################################################
# Done.
# #############################################################################