From e299b877adf328571b4b3f38bc63a483724e0296 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 27 Dec 2011 11:50:33 -0700 Subject: [PATCH] Update fnv_64.t and replication_filters.t. --- t/pt-table-checksum/replication_filters.t | 6 ++++++ t/pt-table-checksum/samples/fnv64-sakila-city.txt | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/t/pt-table-checksum/replication_filters.t b/t/pt-table-checksum/replication_filters.t index c37c0e2e..80db7cf1 100644 --- a/t/pt-table-checksum/replication_filters.t +++ b/t/pt-table-checksum/replication_filters.t @@ -23,6 +23,8 @@ shift @INC; # our unshift (above) shift @INC; # PerconaTest's unshift require "$trunk/bin/pt-table-checksum"; +use Data::Dumper; + my $dp = new DSNParser(opts=>$dsn_opts); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $master_dbh = $sb->get_dbh_for('master'); @@ -57,6 +59,8 @@ for my $port ( qw(12346 12347) ) { diag(`echo "replicate-ignore-db=foo" >> /tmp/$port/my.sandbox.cnf`); diag(`/tmp/$port/start >/dev/null`); } +$slave1_dbh = $sb->get_dbh_for('slave1'); +$slave2_dbh = $sb->get_dbh_for('slave2'); my $pos = PerconaTest::get_master_binlog_pos($master_dbh); @@ -102,6 +106,8 @@ for my $port ( qw(12346 12347) ) { diag(`mv /tmp/$port/orig.cnf /tmp/$port/my.sandbox.cnf`); diag(`/tmp/$port/start >/dev/null`); } +$slave1_dbh = $sb->get_dbh_for('slave1'); +$slave2_dbh = $sb->get_dbh_for('slave2'); # ############################################################################# # Issue 982: --empty-replicate-table does not work with binlog-ignore-db diff --git a/t/pt-table-checksum/samples/fnv64-sakila-city.txt b/t/pt-table-checksum/samples/fnv64-sakila-city.txt index b6734505..2d7fb1ae 100644 --- a/t/pt-table-checksum/samples/fnv64-sakila-city.txt +++ b/t/pt-table-checksum/samples/fnv64-sakila-city.txt @@ -2,7 +2,11 @@ -- sakila.city -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(FNV_64(`city_id`, `city`, `country_id`, `last_update` + 0) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` >= ?)) AND ((`city_id` <= ?)) ORDER BY `city_id` /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(FNV_64(`city_id`, `city`, `country_id`, `last_update` + 0) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` >= ?)) AND ((`city_id` <= ?)) /*checksum chunk*/ + +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` < ?)) ORDER BY `city_id` /*past lower chunk*/ + +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` > ?)) ORDER BY `city_id` /*past upper chunk*/ SELECT /*!40001 SQL_NO_CACHE */ `city_id` FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` >= ?)) ORDER BY `city_id` LIMIT ?, 2 /*next chunk boundary*/ @@ -10,7 +14,11 @@ SELECT /*!40001 SQL_NO_CACHE */ `city_id` FROM `sakila`.`city` FORCE INDEX(`PRIM -- sakila.film_actor -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(FNV_64(`actor_id`, `film_id`, `last_update` + 0) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`film_actor` FORCE INDEX(`PRIMARY`) WHERE ((`actor_id` > ?) OR (`actor_id` = ? AND `film_id` >= ?)) AND ((`actor_id` < ?) OR (`actor_id` = ? AND `film_id` <= ?)) ORDER BY `actor_id`, `film_id` /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(FNV_64(`actor_id`, `film_id`, `last_update` + 0) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`film_actor` FORCE INDEX(`PRIMARY`) WHERE ((`actor_id` > ?) OR (`actor_id` = ? AND `film_id` >= ?)) AND ((`actor_id` < ?) OR (`actor_id` = ? AND `film_id` <= ?)) /*checksum chunk*/ + +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `sakila`.`film_actor` FORCE INDEX(`PRIMARY`) WHERE ((`actor_id` < ?) OR (`actor_id` = ? AND `film_id` < ?)) ORDER BY `actor_id`, `film_id` /*past lower chunk*/ + +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `sakila`.`film_actor` FORCE INDEX(`PRIMARY`) WHERE ((`actor_id` > ?) OR (`actor_id` = ? AND `film_id` > ?)) ORDER BY `actor_id`, `film_id` /*past upper chunk*/ SELECT /*!40001 SQL_NO_CACHE */ `actor_id`, `actor_id`, `film_id` FROM `sakila`.`film_actor` FORCE INDEX(`PRIMARY`) WHERE ((`actor_id` > ?) OR (`actor_id` = ? AND `film_id` >= ?)) ORDER BY `actor_id`, `film_id` LIMIT ?, 2 /*next chunk boundary*/