mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-16 16:23:30 +00:00
Merge branch '3.0' into PT-143
This commit is contained in:
@@ -52,7 +52,7 @@ my $want = [
|
||||
key_len => 2,
|
||||
ref => 'const',
|
||||
rows => 1,
|
||||
Extra => $sandbox_version gt '5.6' ? undef : '',
|
||||
Extra => $sandbox_version eq '5.6' ? undef : '',
|
||||
},
|
||||
];
|
||||
if ( $sandbox_version gt '5.6' ) {
|
||||
|
@@ -115,6 +115,25 @@ like(
|
||||
"..but an unknown charset fails"
|
||||
);
|
||||
|
||||
local $SIG{__WARN__} = undef;
|
||||
|
||||
$sb->load_file('master', 't/pt-archiver/samples/table2.sql');
|
||||
`rm -f archive.test.table_2`;
|
||||
$output = output(
|
||||
sub { pt_archiver::main(qw(--where 1=1 --output-format=csv), "--source", "D=test,t=table_2,F=$cnf", "--file", 'archive.%D.%t') },
|
||||
);
|
||||
$output = `cat archive.test.table_2`;
|
||||
is($output, <<EOF
|
||||
1, 2, 3, "4"
|
||||
2, "\\N", 3, "4"
|
||||
3, 2, 3, "\\\t"
|
||||
4, 2, 3, "\\\n"
|
||||
5, 2, 3, "Zapp \\"Brannigan"
|
||||
EOF
|
||||
, '--output-format=csv');
|
||||
`rm -f archive.test.table_2`;
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
19
t/pt-archiver/samples/table2.sql
Normal file
19
t/pt-archiver/samples/table2.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE SCHEMA IF NOT EXISTS test;
|
||||
use test;
|
||||
drop table if exists table_2;
|
||||
|
||||
create table table_2(
|
||||
a int not null primary key,
|
||||
b int,
|
||||
c int not null,
|
||||
d varchar(50),
|
||||
key(b)
|
||||
) engine=innodb;
|
||||
|
||||
insert into table_2 values
|
||||
(1, 2, 3, 4),
|
||||
(2, null, 3, 4),
|
||||
(3, 2, 3, "\t"),
|
||||
(4, 2, 3, "\n"),
|
||||
(5, 2, 3, "Zapp \"Brannigan");
|
||||
|
@@ -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
|
||||
|
@@ -105,7 +105,7 @@ ok(
|
||||
|
||||
$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
|
||||
|
||||
my $max_rows = $sandbox_version < '5.7' ? 75 : 100;
|
||||
my $max_rows = $sandbox_version < '5.7' ? 90 : 100;
|
||||
ok(
|
||||
$row->[0] >= 75 && $row->[0] <= $max_rows,
|
||||
'Between 75 and 90 chunks on master'
|
||||
|
Reference in New Issue
Block a user