Failing test case.

This commit is contained in:
Daniel Nichter
2013-07-10 10:16:07 -07:00
parent b93582d03b
commit 89524dbefa
2 changed files with 69 additions and 0 deletions

View File

@@ -831,6 +831,26 @@ is_deeply(
"Bug 995274: nibble iter works"
);
# #############################################################################
# pt-table-checksum doesn't use non-unique index with highest cardinality
# https://bugs.launchpad.net/percona-toolkit/+bug/1199591
# #############################################################################
diag(`/tmp/12345/use < $trunk/t/lib/samples/cardinality.sql >/dev/null`);
$ni = make_nibble_iter(
db => 'cardb',
tbl => 't',
argv => [qw(--databases cardb --chunk-size 2)],
);
is(
$ni->{index},
'b',
"Use non-unique index with highest cardinality (bug 1199591)"
);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,49 @@
DROP DATABASE IF EXISTS cardb;
CREATE DATABASE cardb;
USE cardb;
CREATE TABLE t (
high INT UNSIGNED NOT NULL,
low INT UNSIGNED NOT NULL,
INDEX a (low),
INDEX b (high),
INDEX c (low)
) ENGINE=InnoDB;
INSERT INTO t VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 2),
(22, 2),
(23, 2),
(24, 2),
(25, 2),
(26, 2),
(27, 2),
(28, 2),
(29, 2),
(30, 2),
(31, 2),
(32, 2),
(33, 2),
(34, 2),
(35, 2),
(36, 2),
(37, 2);
ANALYZE TABLE t;