Remove obsolete tests and unused sample files.

This commit is contained in:
Daniel Nichter
2011-10-11 10:54:29 -06:00
parent df7366d302
commit 2de29214b9
19 changed files with 0 additions and 538 deletions

View File

@@ -1,70 +0,0 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 3;
}
my $output;
my $cnf='/tmp/12345/my.sandbox.cnf';
my $cmd = "$trunk/bin/pt-table-checksum -F $cnf 127.1";
$sb->create_dbs($master_dbh, [qw(test)]);
$sb->load_file('master', 't/pt-table-checksum/samples/issue_122.sql');
# #############################################################################
# Issue 122: mk-table-checksum doesn't --save-since correctly on empty tables
# #############################################################################
`$cmd --arg-table test.argtable --save-since -t test.issue_122 --chunk-size 2`;
is_deeply(
$master_dbh->selectall_arrayref("SELECT since FROM test.argtable WHERE db='test' AND tbl='issue_122'"),
[[undef]],
'Numeric since is not saved when table is empty'
);
$master_dbh->do("INSERT INTO test.issue_122 VALUES (null,'a'),(null,'b')");
`$cmd --arg-table test.argtable --save-since -t test.issue_122 --chunk-size 2`;
is_deeply(
$master_dbh->selectall_arrayref("SELECT since FROM test.argtable WHERE db='test' AND tbl='issue_122'"),
[[2]],
'Numeric since is saved when table is not empty'
);
# Test non-empty table that is chunkable with a temporal --since and
# --save-since to make sure that the current ts gets saved and not the maxval.
$master_dbh->do('UPDATE test.argtable SET since = "current_date - interval 3 day" WHERE db = "test" AND tbl = "issue_122"');
`$cmd --arg-table test.argtable --save-since -t test.issue_122 --chunk-size 2`;
$output = $master_dbh->selectall_arrayref("SELECT since FROM test.argtable WHERE db='test' AND tbl='issue_122'")->[0]->[0];
like(
$output,
qr/^\d{4}-\d{2}-\d{2}(?:.[0-9:]+)?/,
'Temporal since is saved when temporal since is given'
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
exit;

View File

@@ -1,52 +0,0 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
elsif ( !$slave_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave';
}
else {
plan tests => 1;
}
my $output;
my $res;
my $cnf='/tmp/12345/my.sandbox.cnf';
my $cmd = "$trunk/bin/pt-table-checksum -F $cnf 127.1";
# #############################################################################
# Issue 1319: mk-table-checksum -w causes perl error
# #############################################################################
$output = `$trunk/bin/pt-table-checksum h=127.1,P=12345,u=msandbox,p=msandbox P=12346 -d mysql -t user --slave-lag -w 60 2>&1`;
unlike(
$output,
qr/Odd number of elements/,
"--wait doesn't cause error (issue 1319)"
);
# #############################################################################
# Done.
# #############################################################################
exit;

View File

@@ -1,62 +0,0 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
elsif ( !$slave_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave';
}
else {
plan tests => 3;
}
my $output;
my $cnf='/tmp/12345/my.sandbox.cnf';
my $cmd = "$trunk/bin/pt-table-checksum -F $cnf 127.0.0.1";
$sb->create_dbs($master_dbh, [qw(test)]);
$sb->load_file('master', 't/pt-table-checksum/samples/before.sql');
# #############################################################################
# Issue 35: mk-table-checksum dies when one server is missing a table
# #############################################################################
diag(`/tmp/12345/use -e 'SET SQL_LOG_BIN=0; CREATE TABLE test.only_on_master(a int);'`);
$output = `$cmd P=12346 -t test.only_on_master 2>&1`;
like($output, qr/MyISAM\s+NULL\s+0/, 'Table on master checksummed');
like($output, qr/MyISAM\s+NULL\s+NULL/, 'Missing table on slave checksummed');
like(
$output,
qr/test\.only_on_master does not exist on slave 127.0.0.1:12346/,
'Warns about missing slave table'
);
diag(`/tmp/12345/use -e 'SET SQL_LOG_BIN=0; DROP TABLE test.only_on_master;'`);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
$sb->wipe_clean($slave_dbh);
exit;

View File

@@ -1,77 +0,0 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-table-checksum";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
elsif ( !$slave_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave';
}
else {
plan tests => 1;
}
my $output;
my $res;
my $cnf='/tmp/12345/my.sandbox.cnf';
my $cmd = "$trunk/bin/pt-table-checksum -F $cnf 127.1";
$sb->create_dbs($master_dbh, [qw(test)]);
$sb->load_file('master', 't/pt-table-checksum/samples/checksum_tbl.sql');
$sb->load_file('master', 't/pt-table-checksum/samples/issue_94.sql');
sleep 1;
# #############################################################################
# Issue 51: --wait option prevents data from being inserted
# #############################################################################
# This test relies on table issue_94 created somewhere above, which has
# something like:
# mysql> select * from issue_94;
# +----+----+---------+
# | a | b | c |
# +----+----+---------+
# | 1 | 2 | apple |
# | 3 | 4 | banana |
# | 5 | 6 | kiwi |
# | 7 | 8 | orange |
# | 9 | 10 | grape |
# | 11 | 12 | coconut |
# +----+----+---------+
$master_dbh->do('DELETE FROM test.checksum');
# Give it something to think about.
$slave_dbh->do('DELETE FROM test.issue_94 WHERE a > 5');
`$cmd --replicate=test.checksum --algorithm=BIT_XOR --databases test --tables issue_94 --chunk-size 500000 --wait 900`;
my $row = $master_dbh->selectrow_arrayref("SELECT * FROM test.checksum");
is(
$row->[1],
'issue_94',
'--wait does not prevent update to --replicate tbl (issue 51)'
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
$sb->wipe_clean($slave_dbh);
exit;

View File

@@ -1,7 +0,0 @@
USE test;
DROP TABLE IF EXISTS args;
CREATE TABLE args (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
PRIMARY KEY (db, tbl)
);

File diff suppressed because one or more lines are too long

View File

@@ -1,15 +0,0 @@
USE test;
DROP TABLE IF EXISTS issue_122;
CREATE TABLE issue_122 (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
a CHAR(1)
);
DROP TABLE IF EXISTS argtable;
CREATE TABLE argtable (
db CHAR(64) NOT NULL,
tbl CHAR(64) NOT NULL,
since CHAR(64),
PRIMARY KEY (db, tbl)
);
INSERT INTO test.argtable VALUES ('test','issue_122',NULL);

View File

@@ -1,5 +0,0 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test issue_122 1 127.1 MyISAM 2 45e6c489 0 0 NULL NULL
test issue_122 3 127.1 MyISAM 2 45e6c489 0 0 NULL NULL
test issue_122 5 127.1 MyISAM 2 b7905e9e 0 0 NULL NULL
test issue_94 0 127.1 MyISAM NULL 2609439684 0 0 NULL NULL

View File

@@ -1,10 +0,0 @@
USE test;
DROP TABLE IF EXISTS t;
CREATE TABLE t (
i int not null auto_increment primary key,
c varchar(32)
);
INSERT INTO test.t VALUES (null, 'aa'), (null, 'ab'), (null, 'ac'), (null, 'ad');
SET SQL_LOG_BIN=0;
INSERT INTO test.t VALUES (null, 'zz'), (null, 'zb');
SET SQL_LOG_BIN=1;

View File

@@ -1,22 +0,0 @@
drop database if exists test;
create database test;
use test;
create table checksum_test(
a int not null primary key auto_increment
) auto_increment = 5;
insert into checksum_test(a) values (1);
CREATE TABLE checksum (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
chunk int NOT NULL,
boundaries char(64) NOT NULL,
this_crc char(40) NOT NULL,
this_cnt int NOT NULL,
master_crc char(40) NULL,
master_cnt int NULL,
ts timestamp NOT NULL,
PRIMARY KEY (db, tbl, chunk)
) ENGINE=InnoDB;

View File

@@ -1,6 +0,0 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
sakila actor 0 localhost InnoDB NULL 3596356558 0 0 NULL NULL
sakila address 0 localhost InnoDB NULL 3083097758 0 0 NULL NULL
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
sakila2 actor 0 localhost InnoDB NULL 3596356559 0 0 NULL NULL
sakila2 address 0 localhost InnoDB NULL 3083097758 0 0 NULL NULL

View File

@@ -1,5 +0,0 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
sakila actor 0 localhost InnoDB NULL 3596356558 0 0 NULL NULL
sakila actor 0 127.0.0.1 InnoDB NULL 3596356559 0 0 NULL NULL
sakila2 actor2 0 localhost InnoDB NULL 3596356559 0 0 NULL NULL
sakila2 actor2 0 127.0.0.1 InnoDB NULL 3596356559 0 0 NULL NULL

View File

@@ -1,35 +0,0 @@
DATABASE TABLE CHECKSUM
mysql columns_priv 3398182975
mysql columns_priv 3398182975
mysql db 3266477049
mysql db 3266477049
mysql func 1212860919
mysql func 1212860919
mysql help_category 440459947
mysql help_category 440459947
mysql help_keyword 4036367086
mysql help_keyword 4036367086
mysql help_relation 2135601206
mysql help_relation 2135601206
mysql help_topic 1182972054
mysql help_topic 1182972054
mysql host 4086925997
mysql host 4086925997
mysql proc 2455629315
mysql proc 2455629315
mysql procs_priv 1845814295
mysql procs_priv 1845814295
mysql tables_priv 280363444
mysql tables_priv 280363444
mysql time_zone 3541879645
mysql time_zone 3541879645
mysql time_zone_leap_second 2518732586
mysql time_zone_leap_second 2518732586
mysql time_zone_name 2777177516
mysql time_zone_name 2777177516
mysql time_zone_transition 841396046
mysql time_zone_transition 841396046
mysql time_zone_transition_type 1458209022
mysql time_zone_transition_type 1458209022
mysql user 790728204
mysql user 790728204

View File

@@ -1,2 +0,0 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
osc t 0 127.1 MyISAM 26 42f3fef3 0 0 NULL NULL

View File

@@ -1 +0,0 @@
# cannot chunk osc t

View File

@@ -1,3 +0,0 @@
DATABASE TABLE CHUNK COUNT
test checksum_test 0 2
test checksum_test 1 3

View File

@@ -1,26 +0,0 @@
drop database if exists test;
create database test;
use test;
CREATE TABLE `checksum_test` (
`id` int(11) NOT NULL DEFAULT '0',
`date` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
INSERT INTO `checksum_test` VALUES
(1, '2011-03-01'),
(2, '2011-03-01'),
(3, '2011-03-01'),
(4, '2011-03-01'),
(5, '2011-03-01'),
(6, '2011-03-02'),
(7, '2011-03-02'),
(8, '2011-03-02'),
(9, '2011-03-02'),
(10, '2011-03-02'),
(11, '2011-03-03'),
(12, '2011-03-03'),
(13, '2011-03-03'),
(14, '2011-03-03'),
(15, '2011-03-03');

View File

@@ -1,4 +0,0 @@
DATABASE TABLE CHUNK COUNT
test checksum_test 0 1
test checksum_test 1 4
test checksum_test 2 0

View File

@@ -1,26 +0,0 @@
drop database if exists test;
create database test;
use test;
CREATE TABLE `checksum_test` (
`id` varchar(255) NOT NULL,
`date` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
INSERT INTO `checksum_test` VALUES
('Apple', '2011-03-03'),
('banana', '2011-03-01'),
('orange', '2011-03-01'),
('grape', '2011-03-01'),
('kiwi', '2011-03-01'),
('strawberry', '2011-03-02'),
('peach', '2011-03-02'),
('mango', '2011-03-02'),
('tomato', '2011-03-02'),
('nectarine', '2011-03-02'),
('pear', '2011-03-01'),
('lemon', '2011-03-03'),
('lime', '2011-03-03'),
('pineapple', '2011-03-03'),
('raspberry', '2011-03-03');