mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-18 01:33:14 +00:00
Add forked Maatkit tools in bin/ and their tests in t/.
This commit is contained in:
30
t/pt-table-sync/samples/before.sql
Normal file
30
t/pt-table-sync/samples/before.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
use test;
|
||||
|
||||
drop table if exists test1;
|
||||
drop table if exists test2;
|
||||
|
||||
create table test1(
|
||||
a int not null,
|
||||
b char(2) not null,
|
||||
primary key(a, b)
|
||||
) ENGINE=INNODB;
|
||||
|
||||
create table test2(
|
||||
a int not null,
|
||||
b char(2) not null,
|
||||
primary key(a, b)
|
||||
) ENGINE=INNODB;
|
||||
|
||||
insert into test1 values(1, 'en'), (2, 'ca');
|
||||
|
||||
drop table if exists test3, test4;
|
||||
create table test3 (
|
||||
id int not null primary key,
|
||||
name varchar(255)
|
||||
);
|
||||
create table test4 (
|
||||
id int not null primary key,
|
||||
name varchar(255)
|
||||
);
|
||||
insert into test3(id, name) values(15034, '51707'),(1, '001');
|
||||
insert into test4(id, name) values(15034, '051707'),(1, '1');
|
18
t/pt-table-sync/samples/bidirectional/master-data.sql
Normal file
18
t/pt-table-sync/samples/bidirectional/master-data.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
use bidi;
|
||||
insert into t values
|
||||
(1, 'abc', 1, '2010-02-01 05:45:30'),
|
||||
(2, 'def', 2, '2010-01-31 06:11:11'),
|
||||
(3, 'ghi', 5, '2010-02-01 09:17:52'), -- 1s newer than remote-1
|
||||
(4, 'jkl', 6, '2010-02-01 10:11:33'),
|
||||
(5, 'mno', 3, '2010-02-01 10:17:40'),
|
||||
(6, 'p', 4, '2010-01-31 10:17:00'),
|
||||
(7, 'qrs', 5, '2010-02-01 10:11:11'),
|
||||
(8, 'tuv', 6, '2010-01-31 10:17:20'),
|
||||
(9, 'wxy', 7, '2010-02-01 10:17:00'),
|
||||
(10, 'z', 8, '2010-01-31 10:17:08'),
|
||||
-- (11, '?', 0, '2010-01-29 11:17:12'), -- in remotes
|
||||
(12, '', 0, '2010-02-01 11:17:00'),
|
||||
(13, NULL, 0, '2010-02-01 12:17:31'),
|
||||
(14, NULL, 0, '2010-01-31 10:17:00'),
|
||||
(15, 'NA', 0, '2010-01-31 07:00:01'),
|
||||
(20, 'new', 100, '2010-02-01 04:15:36'); -- not in remotes
|
18
t/pt-table-sync/samples/bidirectional/remote-1.sql
Normal file
18
t/pt-table-sync/samples/bidirectional/remote-1.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
use bidi;
|
||||
insert into t values
|
||||
(1, 'abc', 1, '2010-02-01 05:45:30'), -- same
|
||||
(2, 'def', 2, '2010-01-31 06:11:11'),
|
||||
(3, 'ghi', 5, '2010-02-01 09:17:51'), -- 1s older than master
|
||||
(4, 'jkl', 6, '2010-02-01 10:11:33'),
|
||||
(5, NULL, 0, '2010-02-02 05:10:00'), -- updated to NULL
|
||||
(6, 'p', 4, '2010-01-31 10:17:00'),
|
||||
(7, 'qrs', 5, '2010-02-01 10:11:11'), -- same
|
||||
(8, 'tuv', 6, '2010-01-31 10:17:20'),
|
||||
(9, 'wxy', 7, '2010-02-01 10:17:00'), -- same
|
||||
(10, 'z', 8, '2010-01-31 10:17:08'),
|
||||
(11, '?', 0, '2010-01-29 11:17:12'), -- new row
|
||||
(12, '', 0, '2010-02-01 11:17:00'),
|
||||
(13, 'hmm', 1, '2010-02-02 12:17:31'), -- newer date, exact time
|
||||
(14, NULL, 0, '2010-01-31 10:17:00'),
|
||||
(15, 'gtg', 7, '2010-02-02 06:01:08'), -- updated
|
||||
(17, 'good', 1, '2010-02-02 21:38:03'); -- new row
|
18
t/pt-table-sync/samples/bidirectional/remote-2.sql
Normal file
18
t/pt-table-sync/samples/bidirectional/remote-2.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
use bidi;
|
||||
insert into t values
|
||||
(1, 'abc', 1, '2010-02-01 05:45:30'),
|
||||
-- error: deleted row
|
||||
(3, 'ghi', 5, '2010-02-01 09:17:52'),
|
||||
(4, 'jkl', 6, '2010-02-01 10:11:33'), -- same
|
||||
(5, 'mno', 3, '2010-02-01 10:17:40'),
|
||||
(6, 'p', 4, '2010-01-31 10:17:00'), -- same
|
||||
(7, 'qrs', 5, '2010-02-01 10:11:11'),
|
||||
(8, 'TUV', 6, '2010-01-31 10:17:20'), -- error: updated val but not ts
|
||||
(9, 'wxy', 7, '2010-02-01 10:17:00'),
|
||||
(10, 'rdy', 5, '2010-02-02 09:09:10'), -- updated
|
||||
(11, '?', 0, '2010-01-29 12:19:48'), -- new/updated
|
||||
(12, '', 0, '2010-02-01 13:17:19'), -- newer time, exact date
|
||||
(13, NULL, 0, '2010-02-01 12:17:31'),
|
||||
(14, NULL, 0, '2010-02-02 13:00:00'), -- updated
|
||||
(15, 'NA', 0, '2010-01-31 07:00:01'),
|
||||
(16, NULL, 0, '2010-02-02 13:20:00'); -- new row
|
11
t/pt-table-sync/samples/bidirectional/table.sql
Normal file
11
t/pt-table-sync/samples/bidirectional/table.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
drop database if exists bidi;
|
||||
create database bidi;
|
||||
use bidi;
|
||||
CREATE TABLE `t` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`c` varchar(255) default NULL,
|
||||
`d` int(1) unsigned NOT NULL default 0,
|
||||
`ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `ts` (`ts`)
|
||||
) ENGINE=InnoDB;
|
16
t/pt-table-sync/samples/checksum_tbl.sql
Normal file
16
t/pt-table-sync/samples/checksum_tbl.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
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(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)
|
||||
);
|
13
t/pt-table-sync/samples/filter_tables.sql
Normal file
13
t/pt-table-sync/samples/filter_tables.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
drop database if exists issue_806_1;
|
||||
drop database if exists issue_806_2;
|
||||
create database issue_806_1;
|
||||
create database issue_806_2;
|
||||
|
||||
use issue_806_1;
|
||||
create table t1 (i int, unique index (i));
|
||||
create table t2 (i int, unique index (i));
|
||||
|
||||
use issue_806_2;
|
||||
create table t1 (i int, unique index (i));
|
||||
create table t2 (i int, unique index (i));
|
||||
create table t3 (i int, unique index (i));
|
13
t/pt-table-sync/samples/issue_1052.sql
Normal file
13
t/pt-table-sync/samples/issue_1052.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
drop database if exists issue_1052;
|
||||
create database issue_1052;
|
||||
use issue_1052;
|
||||
CREATE TABLE `t` (
|
||||
`opt_id` int(10) NOT NULL auto_increment,
|
||||
`value` text collate utf8_unicode_ci NOT NULL,
|
||||
`option` varchar(250) collate utf8_unicode_ci NOT NULL,
|
||||
`desc` varchar(300) collate utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`opt_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
insert into issue_1052.t values (null, 'val', 'opt', 'something');
|
||||
set session sql_log_bin=0;
|
||||
insert into issue_1052.t values (null, '', 'opt2', 'something else');
|
14
t/pt-table-sync/samples/issue_22.sql
Normal file
14
t/pt-table-sync/samples/issue_22.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
DROP TABLE IF EXISTS `messages`;
|
||||
CREATE TABLE `messages` (
|
||||
`MID` int(20) NOT NULL default '0',
|
||||
`TID` bigint(20) NOT NULL default '0',
|
||||
`AUTHOR` varchar(32) NOT NULL default '',
|
||||
`DATE` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`INTERNAL` char(1) NOT NULL default '0',
|
||||
`ISOPER` char(1) NOT NULL default '0',
|
||||
`HEADERS` text NOT NULL,
|
||||
`MSG` text NOT NULL,
|
||||
PRIMARY KEY (`MID`),
|
||||
UNIQUE KEY `ID` (`MID`),
|
||||
KEY `TID` (`TID`)
|
||||
) TYPE=MyISAM;
|
17
t/pt-table-sync/samples/issue_367.sql
Normal file
17
t/pt-table-sync/samples/issue_367.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
CREATE DATABASE db1;
|
||||
USE db1;
|
||||
CREATE TABLE db1.t1 (i INT NOT NULL, UNIQUE INDEX (i));
|
||||
DELIMITER |
|
||||
CREATE TRIGGER mytrg BEFORE INSERT ON db1.t1
|
||||
FOR EACH ROW BEGIN
|
||||
-- This trigger doesn't have to do anything, it just needs to exist.
|
||||
END;
|
||||
|
|
||||
DELIMITER ;
|
||||
|
||||
DROP DATABASE IF EXISTS db2;
|
||||
CREATE DATABASE db2;
|
||||
USE db2;
|
||||
CREATE TABLE db2.t1 (i INT NOT NULL, UNIQUE INDEX (i));
|
||||
INSERT INTO db2.t1 VALUES (1), (2), (3), (4), (5);
|
7
t/pt-table-sync/samples/issue_37.sql
Normal file
7
t/pt-table-sync/samples/issue_37.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS `issue_37`;
|
||||
CREATE TABLE `issue_37` (
|
||||
a INT DEFAULT 0,
|
||||
UNIQUE INDEX idx_a (a)
|
||||
);
|
||||
CREATE TRIGGER a_trig BEFORE INSERT ON issue_37 FOR EACH ROW SET @a = @a + NEW.a;
|
112
t/pt-table-sync/samples/issue_375.sql
Normal file
112
t/pt-table-sync/samples/issue_375.sql
Normal file
@@ -0,0 +1,112 @@
|
||||
DROP DATABASE IF EXISTS issue_375;
|
||||
CREATE DATABASE issue_375;
|
||||
USE issue_375;
|
||||
|
||||
CREATE TABLE t (
|
||||
id int PRIMARY KEY,
|
||||
updated_at datetime NOT NULL,
|
||||
foo varchar(16),
|
||||
UNIQUE INDEX (updated_at)
|
||||
);
|
||||
|
||||
INSERT INTO issue_375.t VALUES
|
||||
(1, '2009-09-03 14:15:00', 'a'),
|
||||
(2, '2009-09-03 14:15:10', 'b'),
|
||||
(3, '2009-09-03 14:15:20', 'c'),
|
||||
(4, '2009-09-03 14:15:40', 'd'),
|
||||
(5, '2009-09-03 14:16:10', 'e'),
|
||||
(6, '2009-09-03 14:16:20', 'f'),
|
||||
(7, '2009-09-03 14:16:50', 'g'),
|
||||
(8, '2009-09-03 14:17:00', 'h'),
|
||||
(9, '2009-09-03 14:17:30', 'j'),
|
||||
(10, '2009-09-03 14:18:00', 'k'),
|
||||
(11, '2009-09-03 14:18:05', 'l'),
|
||||
(12, '2009-09-03 14:18:09', 'm'),
|
||||
(13, '2009-09-03 14:18:11', 'n'),
|
||||
(14, '2009-09-03 14:18:23', 'o'),
|
||||
(15, '2009-09-03 14:18:49', 'p'),
|
||||
(16, '2009-09-03 14:18:59', 'q'),
|
||||
(17, '2009-09-06 15:00:00', 'q'),
|
||||
(18, '2009-09-06 15:00:01', 'r'),
|
||||
(19, '2009-09-06 15:00:02', 's'),
|
||||
(20, '2009-09-06 15:00:03', 't'),
|
||||
(21, '2009-09-06 15:00:04', 'u'),
|
||||
(22, '2009-09-06 15:00:05', 'v'),
|
||||
(23, '2009-09-06 15:00:06', 'w'),
|
||||
(24, '2009-09-06 15:00:07', 'x'),
|
||||
(25, '2009-09-06 15:00:08', 'y'),
|
||||
(26, '2009-09-06 15:00:09', 'z'),
|
||||
(27, '2009-09-06 15:00:10', 'aa'),
|
||||
(28, '2009-09-06 15:00:11', 'ab'),
|
||||
(29, '2009-09-06 15:00:12', 'ac'),
|
||||
(30, '2009-09-06 15:00:13', 'ad'),
|
||||
(31, '2009-09-06 15:00:14', 'ae'),
|
||||
(32, '2009-09-06 15:00:15', 'af'),
|
||||
(33, '2009-09-06 15:00:16', 'ag'),
|
||||
(34, '2009-09-06 15:00:17', 'ah'),
|
||||
(35, '2009-09-06 15:00:18', 'ai'),
|
||||
(36, '2009-09-06 15:00:19', 'aj'),
|
||||
(37, '2009-09-06 15:00:20', 'ak'),
|
||||
(38, '2009-09-06 15:00:21', 'al'),
|
||||
(39, '2009-09-06 15:00:22', 'am'),
|
||||
(40, '2009-09-06 15:00:23', 'an'),
|
||||
(41, '2009-09-06 15:00:24', 'ao'),
|
||||
(42, '2009-09-06 15:00:25', 'ap'),
|
||||
(43, '2009-09-06 15:00:26', 'aq'),
|
||||
(44, '2009-09-06 15:00:27', 'ar'),
|
||||
(45, '2009-09-06 15:00:28', 'as'),
|
||||
(46, '2009-09-06 15:00:29', 'at'),
|
||||
(47, '2009-09-06 15:00:30', 'au'),
|
||||
(48, '2009-09-06 15:00:31', 'av'),
|
||||
(49, '2009-09-06 15:00:32', 'aw'),
|
||||
(50, '2009-09-06 15:00:33', 'ax'),
|
||||
(51, '2009-09-06 15:00:34', 'ay'),
|
||||
(52, '2009-09-06 15:00:35', 'az'),
|
||||
(53, '2009-09-06 15:00:36', 'ba'),
|
||||
(54, '2009-09-06 15:00:37', 'bb'),
|
||||
(55, '2009-09-06 15:00:38', 'bc'),
|
||||
(56, '2009-09-06 15:00:39', 'bd'),
|
||||
(57, '2009-09-06 15:00:40', 'be'),
|
||||
(58, '2009-09-06 15:00:41', 'bf'),
|
||||
(59, '2009-09-06 15:00:42', 'bg'),
|
||||
(60, '2009-09-06 15:00:43', 'bh'),
|
||||
(61, '2009-09-06 15:00:44', 'bi'),
|
||||
(62, '2009-09-06 15:00:45', 'bj'),
|
||||
(63, '2009-09-06 15:00:46', 'bk'),
|
||||
(64, '2009-09-06 15:00:47', 'bl'),
|
||||
(65, '2009-09-06 15:00:48', 'bm'),
|
||||
(66, '2009-09-06 15:00:49', 'bn'),
|
||||
(67, '2009-09-06 15:00:50', 'bo'),
|
||||
(68, '2009-09-06 15:00:51', 'bp'),
|
||||
(69, '2009-09-06 15:00:52', 'bq'),
|
||||
(70, '2009-09-06 15:00:53', 'br'),
|
||||
(71, '2009-09-06 15:00:54', 'bs'),
|
||||
(72, '2009-09-06 15:00:55', 'bt'),
|
||||
(73, '2009-09-06 15:00:56', 'bu'),
|
||||
(74, '2009-09-06 15:00:57', 'bv'),
|
||||
(75, '2009-09-06 15:00:58', 'bw'),
|
||||
(76, '2009-09-06 15:00:59', 'bx'),
|
||||
(77, '2009-09-06 15:01:00', 'by'),
|
||||
(78, '2009-09-06 15:01:01', 'bz'),
|
||||
(79, '2009-09-06 15:01:02', 'ca'),
|
||||
(80, '2009-09-06 15:01:03', 'cb'),
|
||||
(81, '2009-09-06 15:01:04', 'cc'),
|
||||
(82, '2009-09-06 15:01:05', 'cd'),
|
||||
(83, '2009-09-06 15:01:06', 'ce'),
|
||||
(84, '2009-09-06 15:01:07', 'cf'),
|
||||
(85, '2009-09-06 15:01:08', 'cg'),
|
||||
(86, '2009-09-06 15:01:09', 'ch'),
|
||||
(87, '2009-09-06 15:01:10', 'ci'),
|
||||
(88, '2009-09-06 15:01:11', 'cj'),
|
||||
(89, '2009-09-06 15:01:12', 'ck'),
|
||||
(90, '2009-09-06 15:01:13', 'cl'),
|
||||
(91, '2009-09-06 15:01:14', 'cm'),
|
||||
(92, '2009-09-06 15:01:15', 'cn'),
|
||||
(93, '2009-09-06 15:01:16', 'co'),
|
||||
(94, '2009-09-06 15:01:17', 'cp'),
|
||||
(95, '2009-09-06 15:01:18', 'cq'),
|
||||
(96, '2009-09-06 15:01:19', 'cr'),
|
||||
(97, '2009-09-06 15:01:20', 'cs'),
|
||||
(98, '2009-09-06 15:01:21', 'ct'),
|
||||
(99, '2009-09-06 15:01:22', 'cu'),
|
||||
(100, '2009-09-06 15:01:23', 'cv');
|
8
t/pt-table-sync/samples/issue_533.sql
Normal file
8
t/pt-table-sync/samples/issue_533.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
DROP DATABASE IF EXISTS onlythisdb;
|
||||
CREATE DATABASE onlythisdb;
|
||||
USE onlythisdb;
|
||||
CREATE TABLE t (
|
||||
i INT,
|
||||
UNIQUE INDEX (i)
|
||||
);
|
||||
INSERT INTO onlythisdb.t VALUES (1), (2), (3);
|
23
t/pt-table-sync/samples/issue_560.sql
Normal file
23
t/pt-table-sync/samples/issue_560.sql
Normal file
File diff suppressed because one or more lines are too long
5
t/pt-table-sync/samples/issue_560_output_1.txt
Normal file
5
t/pt-table-sync/samples/issue_560_output_1.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Differences on P=12346,h=127.0.0.1
|
||||
DB TBL CHUNK CNT_DIFF CRC_DIFF BOUNDARIES
|
||||
issue_560 buddy_list 7 0 1 `player_id` >= '301' AND `player_id` < '351'
|
||||
issue_560 buddy_list 10 0 1 `player_id` >= '451'
|
||||
|
22
t/pt-table-sync/samples/issue_560_output_2.txt
Normal file
22
t/pt-table-sync/samples/issue_560_output_2.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# Syncing via replication P=12346,h=127.1,p=...,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '350') OR (`player_id` = '350' AND `buddy_id` <= '2454'))) AND ((`player_id` >= '301' AND `player_id` < '351')) FOR UPDATE
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '350') OR (`player_id` = '350' AND `buddy_id` <= '2454'))) AND ((`player_id` >= '301' AND `player_id` < '351')) LOCK IN SHARE MODE
|
||||
# SELECT /*rows in nibble*/ `player_id`, `buddy_id`, CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS __crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '350') OR (`player_id` = '350' AND `buddy_id` <= '2454'))) AND (`player_id` >= '301' AND `player_id` < '351') ORDER BY `player_id`, `buddy_id` FOR UPDATE
|
||||
# SELECT /*rows in nibble*/ `player_id`, `buddy_id`, CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS __crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '350') OR (`player_id` = '350' AND `buddy_id` <= '2454'))) AND (`player_id` >= '301' AND `player_id` < '351') ORDER BY `player_id`, `buddy_id` LOCK IN SHARE MODE
|
||||
DELETE FROM `issue_560`.`buddy_list` WHERE `player_id`='333' AND `buddy_id`='0' LIMIT 1;
|
||||
DELETE FROM `issue_560`.`buddy_list` WHERE `player_id`='334' AND `buddy_id`='0' LIMIT 1;
|
||||
REPLACE INTO `issue_560`.`buddy_list`(`player_id`, `buddy_id`) VALUES ('333', '3414');
|
||||
REPLACE INTO `issue_560`.`buddy_list`(`player_id`, `buddy_id`) VALUES ('334', '6626');
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE ((((`player_id` > '350') OR (`player_id` = '350' AND `buddy_id` > '2454')) AND 1=1)) AND ((`player_id` >= '301' AND `player_id` < '351')) FOR UPDATE
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE ((((`player_id` > '350') OR (`player_id` = '350' AND `buddy_id` > '2454')) AND 1=1)) AND ((`player_id` >= '301' AND `player_id` < '351')) LOCK IN SHARE MODE
|
||||
# 2 2 0 0 Nibble 00:00:00 00:00:00 2 issue_560.buddy_list
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '500') OR (`player_id` = '500' AND `buddy_id` <= '4272'))) AND ((`player_id` >= '451')) FOR UPDATE
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '500') OR (`player_id` = '500' AND `buddy_id` <= '4272'))) AND ((`player_id` >= '451')) LOCK IN SHARE MODE
|
||||
# SELECT /*rows in nibble*/ `player_id`, `buddy_id`, CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS __crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '500') OR (`player_id` = '500' AND `buddy_id` <= '4272'))) AND (`player_id` >= '451') ORDER BY `player_id`, `buddy_id` FOR UPDATE
|
||||
# SELECT /*rows in nibble*/ `player_id`, `buddy_id`, CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS __crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE (((`player_id` < '500') OR (`player_id` = '500' AND `buddy_id` <= '4272'))) AND (`player_id` >= '451') ORDER BY `player_id`, `buddy_id` LOCK IN SHARE MODE
|
||||
DELETE FROM `issue_560`.`buddy_list` WHERE `player_id`='486' AND `buddy_id`='0' LIMIT 1;
|
||||
REPLACE INTO `issue_560`.`buddy_list`(`player_id`, `buddy_id`) VALUES ('486', '1660');
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE ((((`player_id` > '500') OR (`player_id` = '500' AND `buddy_id` > '4272')) AND 1=1)) AND ((`player_id` >= '451')) FOR UPDATE
|
||||
# SELECT /*issue_560.buddy_list:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `player_id`, `buddy_id`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_560`.`buddy_list` FORCE INDEX (`PRIMARY`) WHERE ((((`player_id` > '500') OR (`player_id` = '500' AND `buddy_id` > '4272')) AND 1=1)) AND ((`player_id` >= '451')) LOCK IN SHARE MODE
|
||||
# 1 1 0 0 Nibble 00:00:00 00:00:00 2 issue_560.buddy_list
|
12
t/pt-table-sync/samples/issue_631.sql
Normal file
12
t/pt-table-sync/samples/issue_631.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
DROP DATABASE IF EXISTS d1;
|
||||
DROP DATABASE IF EXISTS d2;
|
||||
DROP DATABASE IF EXISTS d3;
|
||||
CREATE DATABASE d1;
|
||||
CREATE DATABASE d2;
|
||||
CREATE DATABASE d3;
|
||||
CREATE TABLE d1.t (x int primary key);
|
||||
CREATE TABLE d2.t (x int primary key);
|
||||
CREATE TABLE d3.t (x int primary key);
|
||||
INSERT INTO d1.t VALUES (1), (2), (3);
|
||||
INSERT INTO d2.t VALUES (2), (3);
|
||||
INSERT INTO d3.t VALUES (3);
|
9
t/pt-table-sync/samples/issue_631_output_1.txt
Normal file
9
t/pt-table-sync/samples/issue_631_output_1.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# Syncing D=d2,P=12345,h=127.1,p=...,t=t,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
INSERT INTO `d2`.`t`(`x`) VALUES ('1');
|
||||
# 0 0 1 0 GroupBy 00:00:00 00:00:00 2 d1.t
|
||||
# Syncing D=d3,P=12345,h=127.1,p=...,t=t,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
INSERT INTO `d3`.`t`(`x`) VALUES ('1');
|
||||
INSERT INTO `d3`.`t`(`x`) VALUES ('2');
|
||||
# 0 0 2 0 GroupBy 00:00:00 00:00:00 2 d1.t
|
9
t/pt-table-sync/samples/issue_631_output_2.txt
Normal file
9
t/pt-table-sync/samples/issue_631_output_2.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# Syncing D=d2,P=12345,h=127.1,p=...,t=t,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
INSERT INTO `d2`.`t`(`x`) VALUES ('1');
|
||||
# 0 0 1 0 Stream 00:00:00 00:00:00 2 d1.t
|
||||
# Syncing D=d3,P=12345,h=127.1,p=...,t=t,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
INSERT INTO `d3`.`t`(`x`) VALUES ('1');
|
||||
INSERT INTO `d3`.`t`(`x`) VALUES ('2');
|
||||
# 0 0 2 0 Stream 00:00:00 00:00:00 2 d1.t
|
6
t/pt-table-sync/samples/issue_634.sql
Normal file
6
t/pt-table-sync/samples/issue_634.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
DROP DATABASE IF EXISTS issue_634;
|
||||
CREATE DATABASE issue_634;
|
||||
USE issue_634;
|
||||
CREATE TABLE t (
|
||||
i int primary key
|
||||
);
|
19
t/pt-table-sync/samples/issue_644.sql
Normal file
19
t/pt-table-sync/samples/issue_644.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
DROP DATABASE IF EXISTS issue_644;
|
||||
CREATE DATABASE issue_644;
|
||||
USE issue_644;
|
||||
CREATE TABLE `t` (
|
||||
`legacy` varchar(255) default NULL,
|
||||
`new_one` varchar(255) default NULL,
|
||||
UNIQUE KEY `idx` (`legacy`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO issue_644.t VALUES
|
||||
('0611743165-2519-n-greenview-ave', '14293130030000'),
|
||||
('0611743165-2520-n-greenview-ave', '14293130030001'),
|
||||
('0611743165-2521-n-greenview-ave', '14293130030002'), -- first boundary
|
||||
('0611743165-3001-z-greenview-ave', '14293130030003'),
|
||||
('0611743165-2520-z-greenview-ave', '14293130030004'),
|
||||
('601940318', '14334230481014'), -- leads back to first boundary
|
||||
('600000500', '14334230481015'),
|
||||
('600005000', '14334230481016'),
|
||||
('601940320', '14334230481017'); -- never reached
|
3
t/pt-table-sync/samples/issue_644_output_1.txt
Normal file
3
t/pt-table-sync/samples/issue_644_output_1.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Syncing P=12346,h=127.1,p=...,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
# 0 0 0 0 Nibble 00:00:00 00:00:00 0 issue_644.t
|
3
t/pt-table-sync/samples/issue_644_output_2.txt
Normal file
3
t/pt-table-sync/samples/issue_644_output_2.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Syncing P=12346,h=127.1,p=...,u=msandbox
|
||||
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
|
||||
# 0 0 0 0 Chunk 00:00:00 00:00:00 0 issue_644.t
|
19
t/pt-table-sync/samples/issue_920.sql
Normal file
19
t/pt-table-sync/samples/issue_920.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
drop database if exists issue_920;
|
||||
create database issue_920;
|
||||
use issue_920;
|
||||
|
||||
CREATE TABLE PK_UK_test (
|
||||
id int(10),
|
||||
id2 int(10),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id2 (id2)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE PK_UK_test_2 (
|
||||
id int(10),
|
||||
id2 int(10),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY id2 (id2)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
insert into PK_UK_test(id,id2) VALUES(1,200),(2,100);
|
39
t/pt-table-sync/samples/issue_965.sql
Normal file
39
t/pt-table-sync/samples/issue_965.sql
Normal file
@@ -0,0 +1,39 @@
|
||||
drop database if exists issue_965;
|
||||
create database issue_965;
|
||||
use issue_965;
|
||||
|
||||
CREATE TABLE `t1` (
|
||||
`b_ref` varchar(20) NOT NULL default '',
|
||||
`r` int(11) NOT NULL default '0',
|
||||
`o_i` int(11) NOT NULL default '0',
|
||||
`r_s` datetime NOT NULL default '1970-01-01 00:00:00',
|
||||
PRIMARY KEY (`b_ref`,`r`,`o_i`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE `t2` (
|
||||
`b_ref` varchar(20) NOT NULL default '',
|
||||
`r` int(11) NOT NULL default '0',
|
||||
`o_i` int(11) NOT NULL default '0',
|
||||
`r_s` datetime NOT NULL default '1970-01-01 00:00:00',
|
||||
PRIMARY KEY (`b_ref`,`r`,`o_i`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
insert into t1 values
|
||||
('aaa', 1, 1, '2010-03-29 14:44'),
|
||||
('aab', 2, 1, '2010-03-29 14:44'),
|
||||
('aac', 3, 1, '2010-03-29 14:44'),
|
||||
('aad', 4, 1, '2010-03-29 14:44'),
|
||||
('aae', 5, 1, '2010-03-29 14:44'),
|
||||
('aaf', 6, 1, '2010-03-29 14:44'),
|
||||
('aag', 7, 1, '2010-03-29 14:44'),
|
||||
('aah', 8, 1, '2010-03-29 14:44');
|
||||
|
||||
insert into t2 values
|
||||
('aaa', 1, 1, '2010-03-29 14:44'),
|
||||
('aab', 2, 1, '2010-03-29 14:44'),
|
||||
('aac', 3, 1, '2010-03-29 14:44'),
|
||||
('aad', 4, 1, '2010-03-29 14:44'),
|
||||
('aae', 5, 100, '2010-03-29 14:44'),
|
||||
('aaf', 6, 1, '2010-03-29 14:44'),
|
||||
('aag', 7, 1, '2010-03-29 14:44'),
|
||||
('aah', 8, 1, '2010-03-29 14:44');
|
18
t/pt-table-sync/samples/lag-slave.sql
Normal file
18
t/pt-table-sync/samples/lag-slave.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
drop database if exists test;
|
||||
create database test;
|
||||
use test;
|
||||
|
||||
create table t1 (
|
||||
i int not null,
|
||||
unique index (i)
|
||||
) engine=innodb;
|
||||
|
||||
insert into t1 values (1);
|
||||
|
||||
create table t2 (
|
||||
id int not null,
|
||||
i int,
|
||||
unique index (id)
|
||||
) engine=innodb;
|
||||
|
||||
insert into t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
|
Reference in New Issue
Block a user