Add test placeholder for bug 1214114.

This commit is contained in:
Daniel Nichter
2013-12-11 18:40:08 -08:00
parent 8ed6c956ac
commit 36cb76d3e9
2 changed files with 38 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ use strict;
use warnings FATAL => 'all'; use warnings FATAL => 'all';
use English qw(-no_match_vars); use English qw(-no_match_vars);
use Test::More; use Test::More;
use Data::Dumper;
use VersionParser; use VersionParser;
use DuplicateKeyFinder; use DuplicateKeyFinder;
@@ -772,6 +773,36 @@ is_deeply(
'Finds duplicates OK on uppercase columns', 'Finds duplicates OK on uppercase columns',
); );
# #############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/1214114
# #############################################################################
#$ddl = load_file('t/lib/samples/dupekeys/prefix_bug_1214114.sql');
#$dupes = [];
#($keys, $ck) = $tp->get_keys($ddl, $opt);
#$dk->get_duplicate_keys(
# $keys,
# clustered_key => $ck,
# clustered => 1,
# callback => $callback,
# tbl_info => { engine => 'InnoDB', ddl => $ddl },
#);
#
#is_deeply(
# $dupes,
# [{
# cols => ['b', 'id'],
# ddl => 'KEY `b` (`b`,`id`)',
# dupe_type => 'clustered',
# duplicate_of => 'PRIMARY',
# duplicate_of_cols => ['id'],
# duplicate_of_ddl => 'PRIMARY KEY (`id`),',
# key => 'b',
# reason => 'Key b ends with a prefix of the clustered index',
# short_key => '`b`',
# }],
# "Prefix bug 1214114"
#) or diag(Dumper($dupes));
# ############################################################################# # #############################################################################
# Done. # Done.
# ############################################################################# # #############################################################################
@@ -787,4 +818,3 @@ like(
'_d() works' '_d() works'
); );
done_testing; done_testing;
exit;

View File

@@ -0,0 +1,7 @@
CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`a` varchar(200) DEFAULT NULL,
`b` decimal(22,0) NOT NULL,
PRIMARY KEY (`id`),
KEY `b` (`b`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1