mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-11 01:01:36 +08:00
Remove PerconaTest::wait_for_table() after calls to Sandbox::load_file() which now implicitly calls Sandbox::wait_for_slaves().
This commit is contained in:
@@ -106,7 +106,6 @@ sub get_id {
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
$sb->load_file('master', "t/lib/samples/compare-results.sql");
|
$sb->load_file('master', "t/lib/samples/compare-results.sql");
|
||||||
PerconaTest::wait_for_table($dbh2, "test.t3", "f > 1");
|
|
||||||
|
|
||||||
$cr = new CompareResults(
|
$cr = new CompareResults(
|
||||||
method => 'checksum',
|
method => 'checksum',
|
||||||
@@ -313,7 +312,6 @@ my $tmpdir = '/tmp/mk-upgrade-res';
|
|||||||
diag(`rm -rf $tmpdir 2>/dev/null; mkdir $tmpdir`);
|
diag(`rm -rf $tmpdir 2>/dev/null; mkdir $tmpdir`);
|
||||||
|
|
||||||
$sb->load_file('master', "t/lib/samples/compare-results.sql");
|
$sb->load_file('master', "t/lib/samples/compare-results.sql");
|
||||||
PerconaTest::wait_for_table($dbh2, "test.t3", "f > 1");
|
|
||||||
|
|
||||||
$cr = new CompareResults(
|
$cr = new CompareResults(
|
||||||
method => 'rows',
|
method => 'rows',
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ sub test_copy_table {
|
|||||||
my ($tbl, $col, $expect) = @args{qw(tbl col expect)};
|
my ($tbl, $col, $expect) = @args{qw(tbl col expect)};
|
||||||
|
|
||||||
$sb->load_file("master", "t/lib/samples/osc/$tbl");
|
$sb->load_file("master", "t/lib/samples/osc/$tbl");
|
||||||
PerconaTest::wait_for_table($dbh, "osc.t", "id=5");
|
|
||||||
$dbh->do("USE osc");
|
$dbh->do("USE osc");
|
||||||
|
|
||||||
$osc->copy(
|
$osc->copy(
|
||||||
|
|||||||
@@ -812,7 +812,6 @@ is(
|
|||||||
# Index case-sensitivity.
|
# Index case-sensitivity.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/undef-arrayref-bug-995274.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/undef-arrayref-bug-995274.sql");
|
||||||
PerconaTest::wait_for_table($dbh, "test.GroupMembers", "id=493076");
|
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$ni = make_nibble_iter(
|
$ni = make_nibble_iter(
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ ok(
|
|||||||
# https://bugs.launchpad.net/percona-toolkit/+bug/987393
|
# https://bugs.launchpad.net/percona-toolkit/+bug/987393
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/empty-table-bug-987393.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/empty-table-bug-987393.sql");
|
||||||
PerconaTest::wait_for_table($dbh, "test.test_full", "id=1");
|
|
||||||
|
|
||||||
$ni = make_nibble_iter(
|
$ni = make_nibble_iter(
|
||||||
db => 'test',
|
db => 'test',
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ SKIP: {
|
|||||||
|
|
||||||
# Bug 932442: column with 2 spaces
|
# Bug 932442: column with 2 spaces
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/2-space-col.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/2-space-col.sql");
|
||||||
PerconaTest::wait_for_table($dbh, "test.t");
|
|
||||||
$ddl = $tp->get_create_table($dbh, qw(test t));
|
$ddl = $tp->get_create_table($dbh, qw(test t));
|
||||||
like(
|
like(
|
||||||
$ddl,
|
$ddl,
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ my $cmd = "$trunk/bin/pt-archiver";
|
|||||||
# Issue 758: Make mk-archiver wait for a slave
|
# Issue 758: Make mk-archiver wait for a slave
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/issue_758.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/issue_758.sql');
|
||||||
PerconaTest::wait_for_table($dbh2, "issue_758.t");
|
|
||||||
|
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$dbh->selectall_arrayref('select * from issue_758.t'),
|
$dbh->selectall_arrayref('select * from issue_758.t'),
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ my $cmd = "perl -I $trunk/t/pt-archiver/samples $trunk/bin/pt-archiver";
|
|||||||
# Bulk delete with limit that results in 2 chunks.
|
# Bulk delete with limit that results in 2 chunks.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
$sb->load_file('master', "t/pt-archiver/samples/delete_more.sql");
|
$sb->load_file('master', "t/pt-archiver/samples/delete_more.sql");
|
||||||
PerconaTest::wait_for_table($dbh, '`db`.`main_table-123`');
|
|
||||||
$dbh->do('use dm');
|
$dbh->do('use dm');
|
||||||
|
|
||||||
is_deeply(
|
is_deeply(
|
||||||
@@ -122,8 +121,6 @@ SKIP: {
|
|||||||
|
|
||||||
# Run it again without DSN b so changes should be made on slave.
|
# Run it again without DSN b so changes should be made on slave.
|
||||||
$sb->load_file('master', "t/pt-archiver/samples/delete_more.sql");
|
$sb->load_file('master', "t/pt-archiver/samples/delete_more.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "`dm`.`main_table-123`", 'id=5');
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, "`dm`.`other_table-123`", 'id=r6');
|
|
||||||
|
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$slave_dbh->selectall_arrayref('select * from `main_table-123` order by id'),
|
$slave_dbh->selectall_arrayref('select * from `main_table-123` order by id'),
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ my $cmd = "$trunk/bin/pt-archiver";
|
|||||||
# Test the custom plugin gt_n.
|
# Test the custom plugin gt_n.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/gt_n.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/gt_n.sql');
|
||||||
PerconaTest::wait_for_table($dbh, 'gt_n.t1', 'status="ok"');
|
|
||||||
my $sql = 'select status, count(*) from gt_n.t1 group by status';
|
my $sql = 'select status, count(*) from gt_n.t1 group by status';
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$dbh->selectall_arrayref($sql),
|
$dbh->selectall_arrayref($sql),
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ my $output;
|
|||||||
# Issue 1152: mk-archiver columns option resulting in null archived table data
|
# Issue 1152: mk-archiver columns option resulting in null archived table data
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
||||||
PerconaTest::wait_for_table($dbh, 'issue_1225.t', "i=3");
|
|
||||||
|
|
||||||
$dbh->do('set names "utf8"');
|
$dbh->do('set names "utf8"');
|
||||||
my $original_rows = $dbh->selectall_arrayref('select * from issue_1225.t where i in (1, 2)');
|
my $original_rows = $dbh->selectall_arrayref('select * from issue_1225.t where i in (1, 2)');
|
||||||
@@ -70,7 +69,6 @@ ok(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
||||||
PerconaTest::wait_for_table($dbh, 'issue_1225.t', "i=3");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub { pt_archiver::main(
|
sub { pt_archiver::main(
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ my $file = "/tmp/mk-archiver-file.txt";
|
|||||||
# archive to file
|
# archive to file
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
||||||
PerconaTest::wait_for_table($dbh, 'issue_1225.t', "i=2");
|
|
||||||
|
|
||||||
$dbh->do('set names "utf8"');
|
$dbh->do('set names "utf8"');
|
||||||
my $original_rows = $dbh->selectall_arrayref('select * from issue_1225.t where i in (1, 2)');
|
my $original_rows = $dbh->selectall_arrayref('select * from issue_1225.t where i in (1, 2)');
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ SKIP: {
|
|||||||
|
|
||||||
# This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.
|
# This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.
|
||||||
$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
|
$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
|
||||||
PerconaTest::wait_for_table($dbh2, 'test.table_2');
|
|
||||||
|
|
||||||
# Change passwords so defaults files won't work.
|
# Change passwords so defaults files won't work.
|
||||||
$dbh->do('SET PASSWORD FOR msandbox = PASSWORD("foo")');
|
$dbh->do('SET PASSWORD FOR msandbox = PASSWORD("foo")');
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ my $rows;
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "pt_osc.t", "id=20");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub { $exit = pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t",
|
sub { $exit = pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t",
|
||||||
@@ -96,13 +95,6 @@ sub test_alter_table {
|
|||||||
|
|
||||||
if ( my $file = $args{file} ) {
|
if ( my $file = $args{file} ) {
|
||||||
$sb->load_file('master', "$sample/$file");
|
$sb->load_file('master', "$sample/$file");
|
||||||
sleep 0.25;
|
|
||||||
if ( my $wait = $args{wait} ) {
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, @$wait);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, $table, "`$pk_col`=$args{max_id}");
|
|
||||||
}
|
|
||||||
$master_dbh->do("USE `$db`");
|
$master_dbh->do("USE `$db`");
|
||||||
$slave_dbh->do("USE `$db`");
|
$slave_dbh->do("USE `$db`");
|
||||||
}
|
}
|
||||||
@@ -366,7 +358,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "rebuild_constraints",
|
check_fks => "rebuild_constraints",
|
||||||
@@ -383,9 +374,6 @@ test_alter_table(
|
|||||||
name => "Basic FK rebuild --execute",
|
name => "Basic FK rebuild --execute",
|
||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
# The previous test should not have modified the table.
|
|
||||||
# file => "basic_with_fks.sql",
|
|
||||||
# wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "rebuild_constraints",
|
check_fks => "rebuild_constraints",
|
||||||
@@ -408,7 +396,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "drop_swap",
|
check_fks => "drop_swap",
|
||||||
@@ -425,9 +412,6 @@ test_alter_table(
|
|||||||
name => "Basic FK drop_swap --execute",
|
name => "Basic FK drop_swap --execute",
|
||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
# The previous test should not have modified the table.
|
|
||||||
# file => "basic_with_fks.sql",
|
|
||||||
# wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "drop_swap",
|
check_fks => "drop_swap",
|
||||||
@@ -451,7 +435,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "rebuild_constraints",
|
check_fks => "rebuild_constraints",
|
||||||
@@ -470,7 +453,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.address",
|
table => "pt_osc.address",
|
||||||
pk_col => "address_id",
|
pk_col => "address_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "new_engine",
|
test_type => "new_engine",
|
||||||
new_engine => "innodb",
|
new_engine => "innodb",
|
||||||
cmds => [
|
cmds => [
|
||||||
@@ -489,7 +471,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.address",
|
table => "pt_osc.address",
|
||||||
pk_col => "address_id",
|
pk_col => "address_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
cmds => [
|
cmds => [
|
||||||
@@ -508,7 +489,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.city",
|
table => "pt_osc.city",
|
||||||
pk_col => "city_id",
|
pk_col => "city_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "drop_col",
|
test_type => "drop_col",
|
||||||
drop_col => "last_update",
|
drop_col => "last_update",
|
||||||
check_fks => "rebuild_constraints",
|
check_fks => "rebuild_constraints",
|
||||||
@@ -556,7 +536,6 @@ SKIP: {
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
diag('Loading file and waiting for replication...');
|
diag('Loading file and waiting for replication...');
|
||||||
$sb->load_file('master', "$sample/basic_with_fks.sql");
|
$sb->load_file('master', "$sample/basic_with_fks.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "pt_osc.address", "address_id=5");
|
|
||||||
|
|
||||||
# Specify --alter-foreign-keys-method for a table with no child tables.
|
# Specify --alter-foreign-keys-method for a table with no child tables.
|
||||||
test_alter_table(
|
test_alter_table(
|
||||||
@@ -564,7 +543,6 @@ test_alter_table(
|
|||||||
table => "pt_osc.country",
|
table => "pt_osc.country",
|
||||||
pk_col => "country_id",
|
pk_col => "country_id",
|
||||||
file => "basic_with_fks.sql",
|
file => "basic_with_fks.sql",
|
||||||
wait => ["pt_osc.address", "address_id=5"],
|
|
||||||
test_type => "new_engine",
|
test_type => "new_engine",
|
||||||
new_engine => "innodb",
|
new_engine => "innodb",
|
||||||
cmds => [
|
cmds => [
|
||||||
@@ -592,8 +570,6 @@ sub test_table {
|
|||||||
my ($file, $name) = @args{qw(file name)};
|
my ($file, $name) = @args{qw(file name)};
|
||||||
|
|
||||||
$sb->load_file('master', "t/lib/samples/osc/$file");
|
$sb->load_file('master', "t/lib/samples/osc/$file");
|
||||||
PerconaTest::wait_for_table($master_dbh, "osc.t", "id=5");
|
|
||||||
PerconaTest::wait_for_table($master_dbh, "osc.__new_t");
|
|
||||||
$master_dbh->do('use osc');
|
$master_dbh->do('use osc');
|
||||||
$master_dbh->do("DROP TABLE IF EXISTS osc.__new_t");
|
$master_dbh->do("DROP TABLE IF EXISTS osc.__new_t");
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ diag(`/tmp/12345/use -u root < $trunk/$sample/osc-user.sql`);
|
|||||||
PerconaTest::wait_for_table($slave1_dbh, "mysql.tables_priv", "user='osc_user'");
|
PerconaTest::wait_for_table($slave1_dbh, "mysql.tables_priv", "user='osc_user'");
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
||||||
PerconaTest::wait_for_table($slave1_dbh, "pt_osc.t", "id=20");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub { $exit_status = pt_online_schema_change::main(@args,
|
sub { $exit_status = pt_online_schema_change::main(@args,
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ throws_ok(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "pt_osc.t", "id=20");
|
|
||||||
$master_dbh->do("USE pt_osc");
|
$master_dbh->do("USE pt_osc");
|
||||||
$slave_dbh->do("USE pt_osc");
|
$slave_dbh->do("USE pt_osc");
|
||||||
|
|
||||||
@@ -90,7 +89,6 @@ throws_ok(
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
$sb->load_file('master', "$sample/basic_no_fks.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "pt_osc.t", "id=20");
|
|
||||||
$master_dbh->do("USE pt_osc");
|
$master_dbh->do("USE pt_osc");
|
||||||
$slave_dbh->do("USE pt_osc");
|
$slave_dbh->do("USE pt_osc");
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ is(
|
|||||||
# ############################################################################
|
# ############################################################################
|
||||||
$master_dbh->do('truncate table percona.checksums');
|
$master_dbh->do('truncate table percona.checksums');
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/3tbl-resume.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/3tbl-resume.sql");
|
||||||
PerconaTest::wait_for_table($slave1_dbh, 'test.t3', "id=26");
|
|
||||||
|
|
||||||
$master_dbh->do('set sql_log_bin=0');
|
$master_dbh->do('set sql_log_bin=0');
|
||||||
$master_dbh->do('truncate table test.t1');
|
$master_dbh->do('truncate table test.t1');
|
||||||
@@ -405,7 +404,6 @@ like(
|
|||||||
# Bug 932442: column with 2 spaces
|
# Bug 932442: column with 2 spaces
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/2-space-col.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/2-space-col.sql");
|
||||||
PerconaTest::wait_for_table($master_dbh, "test.t", "id=10");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub { $exit_status = pt_table_checksum::main(@args,
|
sub { $exit_status = pt_table_checksum::main(@args,
|
||||||
@@ -429,7 +427,6 @@ is(
|
|||||||
# Bug 821675: can't parse column names containing periods
|
# Bug 821675: can't parse column names containing periods
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/dot.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/dot.sql");
|
||||||
PerconaTest::wait_for_table($master_dbh, "test.t", "`No.`='ten'");
|
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
no_diff(
|
no_diff(
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ my $sample = "t/pt-table-checksum/samples/";
|
|||||||
# line 2206
|
# line 2206
|
||||||
# ############################################################################
|
# ############################################################################
|
||||||
$sb->load_file('master', "$sample/undef-arrayref-bug-995274.sql");
|
$sb->load_file('master', "$sample/undef-arrayref-bug-995274.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.GroupMembers", "id=493076");
|
|
||||||
|
|
||||||
# Must chunk the table so an index is used.
|
# Must chunk the table so an index is used.
|
||||||
$output = output(
|
$output = output(
|
||||||
@@ -84,7 +83,6 @@ cmp_ok(
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
$master_dbh->do("DROP DATABASE IF EXISTS percona"); # clear old checksums
|
$master_dbh->do("DROP DATABASE IF EXISTS percona"); # clear old checksums
|
||||||
$sb->load_file('master', "$sample/empty-table-bug-987393.sql");
|
$sb->load_file('master', "$sample/empty-table-bug-987393.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.test_full", "id=1");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub { $exit_status = pt_table_checksum::main(
|
sub { $exit_status = pt_table_checksum::main(
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ is(
|
|||||||
# Bug 978432: PK is ignored
|
# Bug 978432: PK is ignored
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-checksum/samples/not-using-pk-bug.sql");
|
$sb->load_file('master', "t/pt-table-checksum/samples/not-using-pk-bug.sql");
|
||||||
PerconaTest::wait_for_table($dbh, "test.multi_resource_apt", "apt_id=4 AND res_id=4");
|
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
no_diff(
|
no_diff(
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ $master_dbh->do("LOAD DATA LOCAL INFILE '$trunk/t/pt-table-checksum/samples/600c
|
|||||||
$master_dbh->do("SET SQL_LOG_BIN=0");
|
$master_dbh->do("SET SQL_LOG_BIN=0");
|
||||||
$master_dbh->do("DELETE FROM test.t WHERE id > 100");
|
$master_dbh->do("DELETE FROM test.t WHERE id > 100");
|
||||||
$master_dbh->do("SET SQL_LOG_BIN=1");
|
$master_dbh->do("SET SQL_LOG_BIN=1");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.t", "id=600");
|
|
||||||
|
|
||||||
# Now there are 100 rows on the master and 600 on the slave.
|
# Now there are 100 rows on the master and 600 on the slave.
|
||||||
$output = output(
|
$output = output(
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ my $output;
|
|||||||
|
|
||||||
$sb->create_dbs($master_dbh, [qw(test)]);
|
$sb->create_dbs($master_dbh, [qw(test)]);
|
||||||
$sb->load_file('master', 't/pt-table-checksum/samples/issue_94.sql');
|
$sb->load_file('master', 't/pt-table-checksum/samples/issue_94.sql');
|
||||||
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, 'test.issue_94', 'a=11');
|
|
||||||
$slave_dbh->do("update test.issue_94 set c=''");
|
$slave_dbh->do("update test.issue_94 set c=''");
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ else {
|
|||||||
plan tests => 22;
|
plan tests => 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
|
||||||
$sb->wipe_clean($slave_dbh);
|
|
||||||
$sb->create_dbs($master_dbh, [qw(test)]);
|
$sb->create_dbs($master_dbh, [qw(test)]);
|
||||||
|
|
||||||
sub query_slave {
|
sub query_slave {
|
||||||
@@ -171,11 +169,14 @@ $ENV{PTDEBUG} = $dbg || 0;
|
|||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
# Fix bug 911996.
|
# Fix bug 911996.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
|
|
||||||
|
# pt-table-checksum waits for all checksums to replicate to all slaves,
|
||||||
|
# so no need to call $sb->wait_for_slaves() after this.
|
||||||
`$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --max-load '' --lock-wait 3 --chunk-size 50 --chunk-index idx_actor_last_name -t sakila.actor --quiet`;
|
`$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --max-load '' --lock-wait 3 --chunk-size 50 --chunk-index idx_actor_last_name -t sakila.actor --quiet`;
|
||||||
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, "percona.checksums", "db='sakila' and tbl='actor' and chunk=7");
|
|
||||||
$slave_dbh->do("update percona.checksums set this_crc='' where db='sakila' and tbl='actor' and chunk=3");
|
$slave_dbh->do("update percona.checksums set this_crc='' where db='sakila' and tbl='actor' and chunk=3");
|
||||||
$slave_dbh->do("update sakila.actor set last_name='' where actor_id=30");
|
$slave_dbh->do("update sakila.actor set last_name='' where actor_id=30");
|
||||||
|
$sb->wait_for_slaves(); # wait for those ^ updates to replicate to slave2 (!2347)
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub {
|
sub {
|
||||||
@@ -200,14 +201,12 @@ is(
|
|||||||
|
|
||||||
# Fix bug 927771.
|
# Fix bug 927771.
|
||||||
$sb->load_file('master', 't/pt-table-sync/samples/bug_927771.sql');
|
$sb->load_file('master', 't/pt-table-sync/samples/bug_927771.sql');
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.t", "c='j'");
|
|
||||||
|
|
||||||
$slave_dbh->do("update test.t set c='z' where id>8");
|
$slave_dbh->do("update test.t set c='z' where id>8");
|
||||||
|
|
||||||
|
# pt-table-checksum waits for all checksums to replicate to all slaves,
|
||||||
|
# so no need to call $sb->wait_for_slaves() after this.
|
||||||
`$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --max-load '' --lock-wait 3 --chunk-size 2 -t test.t --quiet`;
|
`$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox --max-load '' --lock-wait 3 --chunk-size 2 -t test.t --quiet`;
|
||||||
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, "percona.checksums", "db='test' and tbl='t' and chunk=4");
|
|
||||||
|
|
||||||
$output = output(
|
$output = output(
|
||||||
sub {
|
sub {
|
||||||
pt_table_sync::main('h=127.1,P=12345,u=msandbox,p=msandbox',
|
pt_table_sync::main('h=127.1,P=12345,u=msandbox,p=msandbox',
|
||||||
@@ -217,13 +216,14 @@ $output = output(
|
|||||||
stderr => 1,
|
stderr => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$sb->wait_for_slaves(); # wait for sync to replicate
|
||||||
|
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
qr/REPLACE INTO `test`.`t`\(`id`, `c`\) VALUES \('9', 'i'\)/,
|
qr/REPLACE INTO `test`.`t`\(`id`, `c`\) VALUES \('9', 'i'\)/,
|
||||||
"--replicate with uc index (bug 927771)"
|
"--replicate with uc index (bug 927771)"
|
||||||
);
|
);
|
||||||
|
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.t", "id=10 AND c='j'");
|
|
||||||
my $rows = $slave_dbh->selectall_arrayref("select id, c from test.t where id>8 order by id");
|
my $rows = $slave_dbh->selectall_arrayref("select id, c from test.t where id>8 order by id");
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$rows,
|
$rows,
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ my $slave_dsn = "h=127.1,P=12346,u=msandbox,p=msandbox";
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/wrong-tbl-struct-bug-1003014.sql");
|
$sb->load_file('master', "$sample/wrong-tbl-struct-bug-1003014.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.zzz", "id=111");
|
|
||||||
|
|
||||||
# Make a diff in each table.
|
# Make a diff in each table.
|
||||||
$slave_dbh->do("DELETE FROM test.aaa WHERE STOP_ARCHIVE IN (5,6,7)");
|
$slave_dbh->do("DELETE FROM test.aaa WHERE STOP_ARCHIVE IN (5,6,7)");
|
||||||
@@ -107,9 +106,7 @@ is_deeply(
|
|||||||
# #########################################################################
|
# #########################################################################
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
|
|
||||||
$sb->load_file('master', "$sample/wrong-tbl-struct-bug-1003014.sql");
|
$sb->load_file('master', "$sample/wrong-tbl-struct-bug-1003014.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.zzz", "id=111");
|
|
||||||
|
|
||||||
$slave_dbh->do("DELETE FROM test.aaa WHERE STOP_ARCHIVE IN (5,6,7)");
|
$slave_dbh->do("DELETE FROM test.aaa WHERE STOP_ARCHIVE IN (5,6,7)");
|
||||||
$slave_dbh->do("UPDATE test.zzz SET c='x' WHERE id IN (44,45,46)");
|
$slave_dbh->do("UPDATE test.zzz SET c='x' WHERE id IN (44,45,46)");
|
||||||
|
|||||||
@@ -110,9 +110,7 @@ is(
|
|||||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1002365
|
# https://bugs.launchpad.net/percona-toolkit/+bug/1002365
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
|
|
||||||
$sb->load_file("master", "t/pt-table-sync/samples/simple-tbls.sql");
|
$sb->load_file("master", "t/pt-table-sync/samples/simple-tbls.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.mt1", "id=10");
|
|
||||||
|
|
||||||
# Create a checksum diff in a table that we're going to ignore
|
# Create a checksum diff in a table that we're going to ignore
|
||||||
# when we sync.
|
# when we sync.
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ my @args = ('--sync-to-master', 'h=127.1,P=12346,u=msandbox,p=msandbox',
|
|||||||
# Issue 1065: mk-table-sync --algorithm seems to be case-sensitive
|
# Issue 1065: mk-table-sync --algorithm seems to be case-sensitive
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->load_file('master', "t/pt-table-sync/samples/simple-tbls.sql");
|
$sb->load_file('master', "t/pt-table-sync/samples/simple-tbls.sql");
|
||||||
PerconaTest::wait_for_table($slave1_dbh, "test.it1", "id=10");
|
|
||||||
|
|
||||||
$slave1_dbh->do("delete from test.it1 where id=1 limit 1");
|
$slave1_dbh->do("delete from test.it1 where id=1 limit 1");
|
||||||
|
|
||||||
|
|||||||
@@ -31,15 +31,10 @@ else {
|
|||||||
plan tests => 3;
|
plan tests => 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
|
||||||
$sb->wipe_clean($slave_dbh);
|
|
||||||
$sb->create_dbs($master_dbh, [qw(test)]);
|
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 560: mk-table-sync generates impossible WHERE
|
# Issue 560: mk-table-sync generates impossible WHERE
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
diag(`/tmp/12345/use < $trunk/t/pt-table-sync/samples/issue_560.sql`);
|
$sb->load_file("master", "t/pt-table-sync/samples/issue_560.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, "issue_560.buddy_list", "player_id=353");
|
|
||||||
|
|
||||||
# Make slave differ.
|
# Make slave differ.
|
||||||
$slave_dbh->do('UPDATE issue_560.buddy_list SET buddy_id=0 WHERE player_id IN (333,334)');
|
$slave_dbh->do('UPDATE issue_560.buddy_list SET buddy_id=0 WHERE player_id IN (333,334)');
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ elsif ( !$slave_dbh ) {
|
|||||||
plan skip_all => 'Cannot connect to sandbox slave';
|
plan skip_all => 'Cannot connect to sandbox slave';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plan tests => 3;
|
plan tests => 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
@@ -37,16 +37,28 @@ $sb->create_dbs($master_dbh, [qw(test)]);
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 634: Cannot nibble table because MySQL chose no index
|
# Issue 634: Cannot nibble table because MySQL chose no index
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
diag(`/tmp/12345/use < $trunk/t/pt-table-sync/samples/issue_634.sql`);
|
$sb->load_file('master', "t/pt-table-sync/samples/issue_634.sql");
|
||||||
PerconaTest::wait_for_table($slave_dbh, 'issue_634.t', '1=1' );
|
|
||||||
$slave_dbh->do('insert into issue_634.t values (1)');
|
$slave_dbh->do('insert into issue_634.t values (1)');
|
||||||
$output = `$trunk/bin/pt-table-sync --sync-to-master h=127.1,P=12346,u=msandbox,p=msandbox -d issue_634 --execute --algorithms Nibble 2>&1`;
|
|
||||||
|
$output = output(
|
||||||
|
sub { pt_table_sync::main("h=127.1,P=12346,u=msandbox,p=msandbox",
|
||||||
|
qw(--sync-to-master -d issue_634 --print --execute --algorithms Nibble))
|
||||||
|
},
|
||||||
|
stderr => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
like(
|
||||||
|
$output,
|
||||||
|
qr/DELETE FROM `issue_634`.`t` WHERE `i`='1' LIMIT 1/,
|
||||||
|
"DELETE statement (issue 634)"
|
||||||
|
);
|
||||||
|
|
||||||
unlike(
|
unlike(
|
||||||
$output,
|
$output,
|
||||||
qr/Cannot nibble/,
|
qr/Cannot nibble/,
|
||||||
"Doesn't say it can't nibble the 1-row table (issue 634)"
|
"Doesn't say it can't nibble the 1-row table (issue 634)"
|
||||||
);
|
);
|
||||||
$sb->wait_for_slaves();
|
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$slave_dbh->selectall_arrayref('select * from issue_634.t'),
|
$slave_dbh->selectall_arrayref('select * from issue_634.t'),
|
||||||
[],
|
[],
|
||||||
@@ -57,6 +69,5 @@ is_deeply(
|
|||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->wipe_clean($master_dbh);
|
$sb->wipe_clean($master_dbh);
|
||||||
$sb->wipe_clean($slave_dbh);
|
|
||||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -31,10 +31,7 @@ else {
|
|||||||
plan tests => 2;
|
plan tests => 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
|
||||||
$sb->wipe_clean($slave_dbh);
|
|
||||||
$sb->load_file('master', 't/lib/samples/issue_804.sql');
|
$sb->load_file('master', 't/lib/samples/issue_804.sql');
|
||||||
PerconaTest::wait_for_table($slave_dbh, "issue_804.t", "accountId=100");
|
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 804: mk-table-sync: can't nibble because index name isn't lower case?
|
# Issue 804: mk-table-sync: can't nibble because index name isn't lower case?
|
||||||
|
|||||||
@@ -35,14 +35,11 @@ else {
|
|||||||
plan tests => 3;
|
plan tests => 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->wipe_clean($master_dbh);
|
|
||||||
$sb->create_dbs($master_dbh, [qw(test)]);
|
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 363: lock and rename.
|
# Issue 363: lock and rename.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
$sb->create_dbs($master_dbh, [qw(test)]);
|
||||||
$sb->load_file('master', 't/pt-table-sync/samples/before.sql');
|
$sb->load_file('master', 't/pt-table-sync/samples/before.sql');
|
||||||
PerconaTest::wait_for_table($slave_dbh, "test.test2");
|
|
||||||
|
|
||||||
$output = `$trunk/bin/pt-table-sync --lock-and-rename h=127.1,P=12345 P=12346 2>&1`;
|
$output = `$trunk/bin/pt-table-sync --lock-and-rename h=127.1,P=12345 P=12346 2>&1`;
|
||||||
like($output, qr/requires exactly two/,
|
like($output, qr/requires exactly two/,
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ my $master2_dbh = $sb->get_dbh_for('master2');
|
|||||||
# Load some tables and data (on both, since they're master-master).
|
# Load some tables and data (on both, since they're master-master).
|
||||||
$master1_dbh->do("CREATE DATABASE test");
|
$master1_dbh->do("CREATE DATABASE test");
|
||||||
$sb->load_file("master1", "t/pt-table-sync/samples/before.sql");
|
$sb->load_file("master1", "t/pt-table-sync/samples/before.sql");
|
||||||
PerconaTest::wait_for_table($master2_dbh, "test.test1", "a=2");
|
|
||||||
|
|
||||||
# Make master2 different from master1. So master2 has the _correct_ data,
|
# Make master2 different from master1. So master2 has the _correct_ data,
|
||||||
# and the sync below will make master1 have that data too.
|
# and the sync below will make master1 have that data too.
|
||||||
|
|||||||
@@ -98,11 +98,6 @@ like(
|
|||||||
|
|
||||||
diag('Loading file and waiting for replication');
|
diag('Loading file and waiting for replication');
|
||||||
$sb->load_file('master', 't/pt-table-sync/samples/issue_367.sql');
|
$sb->load_file('master', 't/pt-table-sync/samples/issue_367.sql');
|
||||||
PerconaTest::wait_for_table(
|
|
||||||
$slave_dbh,
|
|
||||||
"$_.t1",
|
|
||||||
"id > 4"
|
|
||||||
) for qw( db1 db2 );
|
|
||||||
|
|
||||||
# Make slave db1.t1 and db2.t1 differ from master.
|
# Make slave db1.t1 and db2.t1 differ from master.
|
||||||
$slave_dbh->do('INSERT INTO db1.t1 VALUES (9)');
|
$slave_dbh->do('INSERT INTO db1.t1 VALUES (9)');
|
||||||
|
|||||||
Reference in New Issue
Block a user