mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
used output instead of full_output. merged bug tests into bugs.t
This commit is contained in:
@@ -373,6 +373,66 @@ like(
|
||||
"Bug 1188264: warning about expected MySQL error 1265"
|
||||
);
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# 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'),
|
||||
},
|
||||
);
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/Child tables:\s*`bug_1315130_a`\.`child_table_in_same_schema` \(approx\. 1 rows\)\s*`bug_1315130_b`\.`child_table_in_second_schema` \(approx\. 1 rows\)[^`]*?Will/s,
|
||||
"Correctly identify child tables from other schemas and ignores tables from same schema referencig same named parent in other schema.",
|
||||
);
|
||||
# clear databases with their foreign keys
|
||||
$sb->load_file('master', "$sample/bug-1315130_cleanup.sql");
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1340728
|
||||
# fails when no index is returned in EXPLAIN, even though --nocheck-plan is set
|
||||
# (happens on HASH indexes)
|
||||
# #############################################################################
|
||||
|
||||
$sb->load_file('master', "$sample/bug-1340728_cleanup.sql");
|
||||
$sb->load_file('master', "$sample/bug-1340728.sql");
|
||||
|
||||
# insert a few thousand rows (else test isn't valid)
|
||||
my $rows = 5000;
|
||||
for (my $i = 0; $i < $rows; $i++) {
|
||||
$master_dbh->do("INSERT INTO bug_1340728.test VALUES (NULL, 'xx')");
|
||||
}
|
||||
|
||||
|
||||
$output = output(
|
||||
sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1340728,t=test",
|
||||
'--execute',
|
||||
'--alter', "ADD COLUMN c INT",
|
||||
'--nocheck-plan',
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/Successfully altered/s,
|
||||
"--nocheck-plan ignores plans without index",
|
||||
);
|
||||
# clear databases
|
||||
$sb->load_file('master', "$sample/bug-1340728_cleanup.sql");
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user