From 07a149f9a728ae6371836165c8f14b5c290d9c28 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Thu, 14 Jun 2018 11:05:32 -0300 Subject: [PATCH] PT-1554 More tests fixed for pt-duplicate-key-checker --- t/pt-duplicate-key-checker/basics.t | 3 ++- .../samples/simple_dupe_bug_1402730.txt | 25 +++++++++++++++++++ .../samples/simple_dupe_bug_1402730_80.txt | 25 +++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730.txt create mode 100644 t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730_80.txt diff --git a/t/pt-duplicate-key-checker/basics.t b/t/pt-duplicate-key-checker/basics.t index 02526fd4..8e578979 100644 --- a/t/pt-duplicate-key-checker/basics.t +++ b/t/pt-duplicate-key-checker/basics.t @@ -153,10 +153,11 @@ ok( # https://bugs.launchpad.net/percona-toolkit/+bug/1402730 # ############################################################################# +$want = $sandbox_version lt '8.0' ? "$sample/simple_dupe_bug_1402730.txt" : "$sample/simple_dupe_bug_1402730_80.txt"; ok( no_diff( sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains --verbose)) }, - "$sample/simple_dupe_bug_1217013.txt", keep_output=>1), + "$want", keep_output=>1), q[--verbose option doesn't skip dupes reporting (bug 1402730)] ) or diag($test_diff); diff --git a/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730.txt b/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730.txt new file mode 100644 index 00000000..4d5d0c4d --- /dev/null +++ b/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730.txt @@ -0,0 +1,25 @@ +# ######################################################################## +# test.domains +# ######################################################################## + +# PRIMARY (`id`) +# domain (`domain`) +# unique_key_domain (`domain`) + +# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint +# domain is a duplicate of unique_key_domain +# Key definitions: +# UNIQUE KEY `domain` (`domain`), +# UNIQUE KEY `unique_key_domain` (`domain`) +# Column types: +# `domain` varchar(175) collate utf8_bin not null +# To remove this duplicate index, execute: +ALTER TABLE `test`.`domains` DROP INDEX `domain`; + +# ######################################################################## +# Summary of indexes +# ######################################################################## + +# Size Duplicate Indexes 527 +# Total Duplicate Indexes 1 +# Total Indexes 3 diff --git a/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730_80.txt b/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730_80.txt new file mode 100644 index 00000000..c64cbd38 --- /dev/null +++ b/t/pt-duplicate-key-checker/samples/simple_dupe_bug_1402730_80.txt @@ -0,0 +1,25 @@ +# ######################################################################## +# test.domains +# ######################################################################## + +# PRIMARY (`id`) +# domain (`domain`) +# unique_key_domain (`domain`) + +# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint +# domain is a duplicate of unique_key_domain +# Key definitions: +# UNIQUE KEY `domain` (`domain`), +# UNIQUE KEY `unique_key_domain` (`domain`) +# Column types: +# `domain` varchar(175) character set utf8 collate utf8_bin not null +# To remove this duplicate index, execute: +ALTER TABLE `test`.`domains` DROP INDEX `domain`; + +# ######################################################################## +# Summary of indexes +# ######################################################################## + +# Size Duplicate Indexes 527 +# Total Duplicate Indexes 1 +# Total Indexes 3