used output instead of full_output. merged bug tests into bugs.t

This commit is contained in:
Frank Cizmich
2014-08-05 12:49:53 -03:00
parent 2c7240bf49
commit e8d7feff61
3 changed files with 60 additions and 164 deletions

View File

@@ -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.
# #############################################################################