Fix pt-table-checksum tests for MySQL 5.0.

This commit is contained in:
Daniel Nichter
2012-02-02 11:15:34 -07:00
parent c40e5db1bf
commit 4607cac898
5 changed files with 77 additions and 6 deletions

View File

@@ -48,6 +48,7 @@ is(
$output = output(
sub { pt_slave_delay::main(@args, qw(--interval 1 --run-time 1)) },
stderr => 1,
);
like(
$output,

View File

@@ -76,7 +76,8 @@ diag(`rm $outfile >/dev/null 2>&1`);
ok(
no_diff(
sub { pt_table_checksum::main(@args) },
"$sample/default-results-5.1.txt",
$sandbox_version gt "5.0 " ? "$sample/default-results-5.1.txt"
: "$sample/default-results-5.0.txt",
post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'',
),
"Default checksum"
@@ -88,7 +89,7 @@ ok(
# other than to ensure that there's at one for each table.
$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
cmp_ok(
$row->[0], '>=', 37,
$row->[0], '>=', ($sandbox_version gt "5.0" ? 37 : 33),
'At least 37 checksums'
);
@@ -99,7 +100,8 @@ cmp_ok(
ok(
no_diff(
sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) },
"$sample/static-chunk-size-results-5.1.txt",
$sandbox_version gt "5.0" ? "$sample/static-chunk-size-results-5.1.txt"
: "$sample/static-chunk-size-results-5.0.txt",
post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'',
),
"Static chunk size (--chunk-time 0)"
@@ -108,14 +110,14 @@ ok(
$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
is(
$row->[0],
86,
($sandbox_version gt "5.0" ? 86 : 82),
'86 checksums on master'
);
$row = $slave_dbh->selectrow_arrayref("select count(*) from percona.checksums");
is(
$row->[0],
86,
($sandbox_version gt "5.0" ? 86 : 82),
'86 checksums on slave'
);

View File

@@ -4,4 +4,4 @@ USE test;
CREATE TABLE t (
id INT NOT NULL PRIMARY KEY,
city VARCHAR(255) NOT NULL
) ENGINE=InnoODB;
) ENGINE=InnoDB;

View File

@@ -0,0 +1,34 @@
ERRORS DIFFS ROWS SKIPPED TABLE
0 0 0 0 mysql.columns_priv
0 0 1 0 mysql.db
0 0 0 0 mysql.func
0 0 36 0 mysql.help_category
0 0 395 0 mysql.help_keyword
0 0 809 0 mysql.help_relation
0 0 422 0 mysql.help_topic
0 0 0 0 mysql.host
0 0 6 0 mysql.proc
0 0 0 0 mysql.procs_priv
0 0 0 0 mysql.tables_priv
0 0 0 0 mysql.time_zone
0 0 0 0 mysql.time_zone_leap_second
0 0 0 0 mysql.time_zone_name
0 0 0 0 mysql.time_zone_transition
0 0 0 0 mysql.time_zone_transition_type
0 0 3 0 mysql.user
0 0 200 0 sakila.actor
0 0 603 0 sakila.address
0 0 16 0 sakila.category
0 0 600 0 sakila.city
0 0 109 0 sakila.country
0 0 599 0 sakila.customer
0 0 1000 0 sakila.film
0 0 5462 0 sakila.film_actor
0 0 1000 0 sakila.film_category
0 0 1000 0 sakila.film_text
0 0 4581 0 sakila.inventory
0 0 6 0 sakila.language
0 0 16049 0 sakila.payment
0 0 16044 0 sakila.rental
0 0 2 0 sakila.staff
0 0 2 0 sakila.store

View File

@@ -0,0 +1,34 @@
ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
0 0 0 1 0 mysql.columns_priv
0 0 1 1 0 mysql.db
0 0 0 1 0 mysql.func
0 0 36 1 0 mysql.help_category
0 0 395 1 0 mysql.help_keyword
0 0 809 1 0 mysql.help_relation
0 0 422 1 0 mysql.help_topic
0 0 0 1 0 mysql.host
0 0 6 1 0 mysql.proc
0 0 0 1 0 mysql.procs_priv
0 0 0 1 0 mysql.tables_priv
0 0 0 1 0 mysql.time_zone
0 0 0 1 0 mysql.time_zone_leap_second
0 0 0 1 0 mysql.time_zone_name
0 0 0 1 0 mysql.time_zone_transition
0 0 0 1 0 mysql.time_zone_transition_type
0 0 3 1 0 mysql.user
0 0 200 1 0 sakila.actor
0 0 603 1 0 sakila.address
0 0 16 1 0 sakila.category
0 0 600 1 0 sakila.city
0 0 109 1 0 sakila.country
0 0 599 1 0 sakila.customer
0 0 1000 1 0 sakila.film
0 0 5462 8 0 sakila.film_actor
0 0 1000 1 0 sakila.film_category
0 0 1000 1 0 sakila.film_text
0 0 4581 7 0 sakila.inventory
0 0 6 1 0 sakila.language
0 0 16049 19 0 sakila.payment
0 0 16044 19 0 sakila.rental
0 0 2 1 0 sakila.staff
0 0 2 1 0 sakila.store