PT-142 pt-online-schema-change find_child_tables slow

This commit is contained in:
Carlos Salguero
2017-05-15 22:01:22 -03:00
parent e4d80c31ec
commit 81f4ff4752
3 changed files with 41 additions and 0 deletions

View File

@@ -445,6 +445,31 @@ $output = output(
# clear databases with their foreign keys
$sb->load_file('master', "$sample/bug-1315130_cleanup.sql");
# #############################################################################
# Issue 1315130
# Failed to detect child tables in other schema, and falsely identified
# child tables in own schema
# #############################################################################
$sb->load_file('master', "$sample/bug-1315130_cleanup.sql");
$sb->load_file('master', "$sample/bug-1315130.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1315130_a,t=parent_table",
'--dry-run',
'--alter', "add column c varchar(16)",
'--alter-foreign-keys-method', 'auto', '--only-same-schema-fks'),
},
);
like(
$output,
qr/Child tables:\s*`bug_1315130_a`\.`child_table_in_same_schema` \(approx\. 1 rows\)[^`]*?Will/s,
"Ignore child tables in other schemas.",
);
# clear databases with their foreign keys
$sb->load_file('master', "$sample/bug-1315130_cleanup.sql");
# #############################################################################
# Issue 1340728