Merge lp:~percona-toolkit-dev/percona-toolkit/fix-dupe-key-checker-bug-969669 into lp:percona-toolkit/2.1

Proposed by Daniel Nichter
Status: Merged
Merged at revision: 318
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-dupe-key-checker-bug-969669
Merge into: lp:percona-toolkit/2.1
Diff against target: 91 lines (+46/-2)
5 files modified
bin/pt-duplicate-key-checker (+1/-1)
t/pt-duplicate-key-checker/basics.t (+30/-1)
t/pt-duplicate-key-checker/samples/key-types-f.txt (+5/-0)
t/pt-duplicate-key-checker/samples/key-types-fk.txt (+5/-0)
t/pt-duplicate-key-checker/samples/key-types-k.txt (+5/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-dupe-key-checker-bug-969669
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+115836@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-duplicate-key-checker'
2--- bin/pt-duplicate-key-checker 2012-07-13 01:42:54 +0000
3+++ bin/pt-duplicate-key-checker 2012-07-19 21:37:33 +0000
4@@ -3566,7 +3566,7 @@
5 $fks = $tp->get_fks($tbl->{ddl}, {database => $tbl->{db}});
6 }
7
8- next TABLE unless %$keys || %$fks;
9+ next TABLE unless ($keys && %$keys) || ($fks && %$fks);
10
11 if ( $o->got('verbose') ) {
12 print_all_keys($keys, $tbl, \%seen_tbl) if $keys;
13
14=== modified file 't/pt-duplicate-key-checker/basics.t'
15--- t/pt-duplicate-key-checker/basics.t 2012-06-05 01:46:35 +0000
16+++ t/pt-duplicate-key-checker/basics.t 2012-07-19 21:37:33 +0000
17@@ -23,7 +23,7 @@
18 plan skip_all => 'Cannot connect to sandbox master';
19 }
20 else {
21- plan tests => 10;
22+ plan tests => 13;
23 }
24
25 my $output;
26@@ -108,6 +108,35 @@
27 );
28
29 # #############################################################################
30+# --key-types
31+# https://bugs.launchpad.net/percona-toolkit/+bug/969669
32+# #############################################################################
33+
34+ok(
35+ no_diff(
36+ sub { pt_duplicate_key_checker::main(@args,
37+ qw(-d sakila --key-types k)) },
38+ "$sample/key-types-k.txt"),
39+ '--key-types k'
40+);
41+
42+ok(
43+ no_diff(
44+ sub { pt_duplicate_key_checker::main(@args,
45+ qw(-d sakila --key-types f)) },
46+ "$sample/key-types-f.txt"),
47+ '--key-types f'
48+);
49+
50+ok(
51+ no_diff(
52+ sub { pt_duplicate_key_checker::main(@args,
53+ qw(-d sakila --key-types fk)) },
54+ "$sample/key-types-fk.txt"),
55+ '--key-types fk (explicit)'
56+);
57+
58+# #############################################################################
59 # Done.
60 # #############################################################################
61 $sb->wipe_clean($dbh);
62
63=== added file 't/pt-duplicate-key-checker/samples/key-types-f.txt'
64--- t/pt-duplicate-key-checker/samples/key-types-f.txt 1970-01-01 00:00:00 +0000
65+++ t/pt-duplicate-key-checker/samples/key-types-f.txt 2012-07-19 21:37:33 +0000
66@@ -0,0 +1,5 @@
67+# ########################################################################
68+# Summary of indexes
69+# ########################################################################
70+
71+# Total Indexes 22
72
73=== added file 't/pt-duplicate-key-checker/samples/key-types-fk.txt'
74--- t/pt-duplicate-key-checker/samples/key-types-fk.txt 1970-01-01 00:00:00 +0000
75+++ t/pt-duplicate-key-checker/samples/key-types-fk.txt 2012-07-19 21:37:33 +0000
76@@ -0,0 +1,5 @@
77+# ########################################################################
78+# Summary of indexes
79+# ########################################################################
80+
81+# Total Indexes 63
82
83=== added file 't/pt-duplicate-key-checker/samples/key-types-k.txt'
84--- t/pt-duplicate-key-checker/samples/key-types-k.txt 1970-01-01 00:00:00 +0000
85+++ t/pt-duplicate-key-checker/samples/key-types-k.txt 2012-07-19 21:37:33 +0000
86@@ -0,0 +1,5 @@
87+# ########################################################################
88+# Summary of indexes
89+# ########################################################################
90+
91+# Total Indexes 41

Subscribers

People subscribed via source and target branches