Add forked Maatkit tools in bin/ and their tests in t/.

This commit is contained in:
Daniel Nichter
2011-06-24 16:02:05 -06:00
parent 6c501128e6
commit b4b6376be1
679 changed files with 177876 additions and 3 deletions

View File

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

View File

@@ -0,0 +1,2 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test issue_21 0 127.0.0.1 InnoDB 5 b88b4eff 0 NULL NULL NULL

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
test ascii SELECT /*test.ascii:1/8*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `i`, `c`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`ascii` FORCE INDEX (`c`) WHERE (`c` < ')')
test ascii `c` < ')'
test ascii `c` >= ')' AND `c` < '1'
test ascii `c` >= '1' AND `c` < '9'
test ascii `c` >= '9' AND `c` < 'A'
test ascii `c` >= 'A' AND `c` < 'I'
test ascii `c` >= 'I' AND `c` < 'Q'
test ascii `c` >= 'Q' AND `c` < 'Y'
test ascii `c` >= 'Y'

View File

@@ -0,0 +1,9 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test ascii 0 127.1 MyISAM 1 25e3643f 0 0 NULL NULL
test ascii 1 127.1 MyISAM 2 1eb24fbb 0 0 NULL NULL
test ascii 2 127.1 MyISAM 0 NULL 0 0 NULL NULL
test ascii 3 127.1 MyISAM 2 fb3ab74d 0 0 NULL NULL
test ascii 4 127.1 MyISAM 51 7c2180e8 0 0 NULL NULL
test ascii 5 127.1 MyISAM 50 b65cecbd 0 0 NULL NULL
test ascii 6 127.1 MyISAM 31 77958122 0 0 NULL NULL
test ascii 7 127.1 MyISAM 5 3c0ef0c2 0 0 NULL NULL

View File

@@ -0,0 +1,9 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test ascii 0 127.1 MyISAM 1 25e3643f 0 0 NULL NULL
test ascii 1 127.1 MyISAM 2 1eb24fbb 0 0 NULL NULL
test ascii 2 127.1 MyISAM 0 NULL 0 0 NULL NULL
test ascii 3 127.1 MyISAM 2 fb3ab74d 0 0 NULL NULL
test ascii 4 127.1 MyISAM OVERSIZE NULL NULL NULL NULL NULL
test ascii 5 127.1 MyISAM OVERSIZE NULL NULL NULL NULL NULL
test ascii 6 127.1 MyISAM 31 77958122 0 0 NULL NULL
test ascii 7 127.1 MyISAM 5 3c0ef0c2 0 0 NULL NULL

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
USE test;
DROP TABLE IF EXISTS checksum;
CREATE TABLE checksum (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
chunk int NOT NULL,
boundaries char(100) 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

@@ -0,0 +1,15 @@
CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS checksum;
CREATE TABLE checksum (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
chunk int NOT NULL,
boundaries char(1) NOT NULL, -- should cause a truncation
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)
);

View File

@@ -0,0 +1,15 @@
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

@@ -0,0 +1,7 @@
USE test;
DROP TABLE IF EXISTS issue_21;
CREATE TABLE issue_21 (
a INT,
b CHAR(1)
) ENGINE=InnoDB;
INSERT INTO issue_21 VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');

View File

@@ -0,0 +1,5 @@
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

@@ -0,0 +1,9 @@
USE test;
DROP TABLE IF EXISTS `issue_47`;
CREATE TABLE `issue_47` (
userid BIGINT UNSIGNED NOT NULL,
INDEX idx (userid)
);
INSERT INTO issue_47 VALUES (1000), (1), (300), (2220293), (65553510),
(9223372036854775807), (20), (55555), (18446744073709551615);

View File

@@ -0,0 +1,23 @@
drop database if exists issue_519;
create database issue_519;
use issue_519;
create table t (
i int unsigned not null auto_increment primary key,
y year not null,
t text,
unique index (y),
index `myidx` (i, y)
);
insert into t values
(null,'2000','a'),
(null,'2001','b'),
(null,'2002','c'),
(null,'2003','d'),
(null,'2004','e'),
(null,'2005','f'),
(null,'2006','g'),
(null,'2007','h'),
(null,'2008','i'),
(null,'2009','j'),
(null,'2010','k');

View File

@@ -0,0 +1,39 @@
-- Issue 602: mk-table-checksum issue with invalid dates
drop database if exists issue_602;
create database issue_602;
use issue_602;
create table t (
a int,
b datetime not null,
key (b)
);
insert into t VALUES (1, "2010-05-09 00:00:00");
insert into t VALUES (2, "2010-05-08 00:00:00");
insert into t VALUES (3, "2010-05-07 00:00:00");
insert into t VALUES (4, "2010-05-06 00:00:00");
insert into t VALUES (5, "2010-05-05 00:00:00");
insert into t VALUES (6, "2010-05-04 00:00:00");
insert into t VALUES (7, "2010-05-03 00:00:00");
insert into t VALUES (8, "2010-05-02 00:00:00");
insert into t VALUES (9, "2010-05-01 00:00:00");
insert into t VALUES (10, "2010-04-30 00:00:00");
-- invalid datetime
insert into t VALUES (11, '2010-00-09 00:00:00' );
-- like t but used in TableChunker.t to test that first_valid_value()
-- only tries a limited number of next rows. So most the rows in this
-- table are invalid.
create table t2 (
a int,
b datetime not null,
key (b)
);
insert into t2 VALUES (1, "2010-00-01 00:00:01");
insert into t2 VALUES (2, "2010-00-02 00:00:02");
insert into t2 VALUES (3, "2010-00-03 00:00:03");
insert into t2 VALUES (4, "2010-00-04 00:00:04");
insert into t2 VALUES (5, "2010-00-05 00:00:05");
insert into t2 VALUES (6, "2010-00-06 00:00:06");
insert into t2 VALUES (7, "2010-01-07 00:00:07");
insert into t2 VALUES (7, "2010-01-08 00:00:08");

View File

@@ -0,0 +1,10 @@
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

@@ -0,0 +1,10 @@
USE test;
DROP TABLE IF EXISTS `issue_94`;
CREATE TABLE `issue_94` (
a INT NOT NULL,
b INT NOT NULL,
c CHAR(16) NOT NULL,
INDEX idx (a)
);
INSERT INTO issue_94 VALUES (1,2,'apple'),(3,4,'banana'),(5,6,'kiwi'),(7,8,'orange'),(9,10,'grape'),(11,12,'coconut');

View File

@@ -0,0 +1,6 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
osc t 0 127.1 MyISAM 0 NULL 0 0 NULL NULL
osc t 1 127.1 MyISAM 23 54a0c224 0 0 NULL NULL
osc t 2 127.1 MyISAM 0 NULL 0 0 NULL NULL
osc t 3 127.1 MyISAM 3 16533cd7 0 0 NULL NULL
osc t 4 127.1 MyISAM 0 NULL 0 0 NULL NULL

View File

@@ -0,0 +1,12 @@
drop database if exists osc;
create database osc;
use osc;
create table t (
i int,
index (i)
);
insert into t values
(1),(2),(3),
(10),(11),(12),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(13),(24),
(101),(102),(103);

View File

@@ -0,0 +1,6 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
osc t 0 127.1 MyISAM 0 NULL 0 0 NULL NULL
osc t 1 127.1 MyISAM OVERSIZE NULL NULL NULL NULL NULL
osc t 2 127.1 MyISAM 0 NULL 0 0 NULL NULL
osc t 3 127.1 MyISAM 3 16533cd7 0 0 NULL NULL
osc t 4 127.1 MyISAM 0 NULL 0 0 NULL NULL

View File

@@ -0,0 +1,22 @@
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

@@ -0,0 +1,9 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test resume 0 127.0.0.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 0 127.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 1 127.0.0.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 1 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 2 127.0.0.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 2 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 3 127.0.0.1 InnoDB 4 bce55ff5 0 0 NULL NULL
test resume 3 127.1 InnoDB 4 bce55ff5 0 0 NULL NULL

View File

@@ -0,0 +1,5 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test resume 0 127.0.0.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 0 127.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 1 127.0.0.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 1 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL

View File

@@ -0,0 +1,3 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test resume 0 127.0.0.1 InnoDB NULL 2465609721 0 0 NULL NULL
test resume 0 127.1 InnoDB NULL 2465609721 0 0 NULL NULL

View File

@@ -0,0 +1,2 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test resume 0 127.0.0.1 InnoDB NULL 2465609721 0 0 NULL NULL

View File

@@ -0,0 +1,5 @@
use test;
create table resume (
i int not null unique key
) engine=innodb;
insert into test.resume values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

View File

@@ -0,0 +1,17 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test2 resume2 0 127.0.0.1 MyISAM 0 NULL 0 0 NULL NULL
test2 resume2 0 127.1 MyISAM 0 NULL 0 0 NULL NULL
test2 resume2 1 127.0.0.1 MyISAM 3 f4dbdf21 0 0 NULL NULL
test2 resume2 1 127.1 MyISAM 3 f4dbdf21 0 0 NULL NULL
test2 resume2 2 127.0.0.1 MyISAM 3 6abf4a82 0 0 NULL NULL
test2 resume2 2 127.1 MyISAM 3 6abf4a82 0 0 NULL NULL
test2 resume2 3 127.0.0.1 MyISAM 4 bce55ff5 0 0 NULL NULL
test2 resume2 3 127.1 MyISAM 4 bce55ff5 0 0 NULL NULL
test resume 0 127.0.0.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 0 127.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 1 127.0.0.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 1 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 2 127.0.0.1 InnoDB 4 bce55ff5 0 0 NULL NULL
test resume 2 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 3 127.0.0.1 InnoDB 4 bce55ff5 0 0 NULL NULL
test resume 3 127.1 InnoDB 4 bce55ff5 0 0 NULL NULL

View File

@@ -0,0 +1,6 @@
DATABASE TABLE CHUNK HOST ENGINE COUNT CHECKSUM TIME WAIT STAT LAG
test resume 0 127.0.0.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 0 127.1 InnoDB 3 f4dbdf21 0 0 NULL NULL
test resume 1 127.0.0.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 1 127.1 InnoDB 3 6abf4a82 0 0 NULL NULL
test resume 2 127.0.0.1 InnoDB 4 bce55ff5 0 0 NULL NULL

View File

@@ -0,0 +1,7 @@
drop database if exists test2;
create database test2;
use test2;
create table resume2 (
i int not null unique key
);
insert into test2.resume2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

View File

@@ -0,0 +1,6 @@
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

@@ -0,0 +1,5 @@
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

@@ -0,0 +1,35 @@
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

@@ -0,0 +1,2 @@
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

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