mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
pt-osc fixed several test files for 5.7 compat
This commit is contained in:
@@ -44,10 +44,10 @@ my $sample = "t/pt-online-schema-change/samples/";
|
||||
$sb->load_file('master1', "$sample/sql-mode-bug-1058285.sql");
|
||||
|
||||
my ($orig_sql_mode) = $dbh->selectrow_array(q{SELECT @@SQL_MODE});
|
||||
is(
|
||||
$orig_sql_mode,
|
||||
"REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,NO_AUTO_VALUE_ON_ZERO",
|
||||
"SQL_MODE set"
|
||||
# check that ANSI_QUOTES and ANSI is there
|
||||
ok(
|
||||
$orig_sql_mode =~ /ANSI_QUOTES.*ANSI/,
|
||||
"ANSI modes set"
|
||||
);
|
||||
|
||||
($output, $exit_status) = full_output(
|
||||
|
||||
@@ -345,7 +345,8 @@ like(
|
||||
# cause a MySQL warning while copying rows.
|
||||
|
||||
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
|
||||
$master_dbh->do("INSERT INTO pt_osc.t VALUES (null, 'This string will be too long after we modify the table so it will cause a warning about the value being truncated in the new table. The other column values are a single character.', NOW())");
|
||||
#This string will be too long after we modify the table so it will cause a warning about the value being truncated in the new table. The other column values are a single character. Note: if STRICT_TRANS or STRICT_ALL is set , an error is raised instead of a warning. STRICT_TRANS is default in 5.7+
|
||||
$master_dbh->do("INSERT INTO pt_osc.t VALUES (null, 'This string will be too long.', NOW())");
|
||||
|
||||
($output, $exit_status) = full_output(
|
||||
sub { pt_online_schema_change::main(@args,
|
||||
@@ -394,7 +395,7 @@ $output = output(
|
||||
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.",
|
||||
"Identify child tables in other schemas and ignore child tables from same schema referencing same named parent in other schema.",
|
||||
);
|
||||
# clear databases with their foreign keys
|
||||
$sb->load_file('master', "$sample/bug-1315130_cleanup.sql");
|
||||
@@ -410,10 +411,16 @@ $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;
|
||||
# will make a big string to do an extended insert because it's much faster
|
||||
|
||||
my $big_insert = 'INSERT INTO bug_1340728.test VALUES ';
|
||||
my $rows = 4999;
|
||||
for (my $i = 0; $i < $rows; $i++) {
|
||||
$master_dbh->do("INSERT INTO bug_1340728.test VALUES (NULL, 'xx')");
|
||||
$big_insert .= "(NULL, 'xx'),";
|
||||
}
|
||||
$big_insert .= "(NULL, 'xx')";
|
||||
|
||||
$master_dbh->do($big_insert);
|
||||
|
||||
|
||||
$output = output(
|
||||
|
||||
@@ -6,7 +6,7 @@ CREATE TABLE `table_name` (
|
||||
`site` varchar(20) NOT NULL DEFAULT '',
|
||||
`update_name` varchar(32) NOT NULL DEFAULT '',
|
||||
`user` varchar(64) NOT NULL DEFAULT '',
|
||||
`time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`time` datetime DEFAULT NULL,
|
||||
`value` varchar(64) NOT NULL DEFAULT '',
|
||||
UNIQUE KEY `site` (`site`,`update_name`,`user`,`value`),
|
||||
KEY `user` (`user`)
|
||||
|
||||
Reference in New Issue
Block a user