Merge lp:~gryp/percona-toolkit/bug1311584 into lp:percona-toolkit/2.2

Proposed by Kenny Gryp
Status: Needs review
Proposed branch: lp:~gryp/percona-toolkit/bug1311584
Merge into: lp:percona-toolkit/2.2
Diff against target: 60 lines (+21/-2)
3 files modified
bin/pt-table-sync (+2/-1)
t/pt-table-sync/columns.t (+6/-1)
t/pt-table-sync/samples/before.sql (+13/-0)
To merge this branch: bzr merge lp:~gryp/percona-toolkit/bug1311584
Reviewer Review Type Date Requested Status
Daniel Nichter Pending
Review via email: mp+216869@code.launchpad.net

Commit message

Fix of bug 1311584: remove case sensitivity for --ignore-columns

Description of the change

Fix of bug 1311584: remove case sensitivity for --ignore-columns

To post a comment you must log in.

Unmerged revisions

600. By root <email address hidden>

working fix now, this computer has the test-environment :)

599. By Kenny Gryp

fix bug https://bugs.launchpad.net/percona-toolkit/+bug/1311584, --ignore-columns should not be case sensitive

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-table-sync'
--- bin/pt-table-sync 2014-02-20 08:10:16 +0000
+++ bin/pt-table-sync 2014-04-23 12:01:14 +0000
@@ -10510,8 +10510,9 @@
1051010510
10511 # Determine which columns to compare.10511 # Determine which columns to compare.
10512 my $ignore_columns = $o->get('ignore-columns');10512 my $ignore_columns = $o->get('ignore-columns');
10513 my %ignore_columns_lc = map { lc $_ => $ignore_columns->{$_} } keys %$ignore_columns;
10513 my @compare_columns = grep {10514 my @compare_columns = grep {
10514 !$ignore_columns->{lc $_};10515 !$ignore_columns_lc{lc $_};
10515 } @{$o->get('columns') || $tbl_struct->{cols}};10516 } @{$o->get('columns') || $tbl_struct->{cols}};
1051610517
10517 # Make sure conflict col is in compare cols else conflicting10518 # Make sure conflict col is in compare cols else conflicting
1051810519
=== modified file 't/pt-table-sync/columns.t'
--- t/pt-table-sync/columns.t 2012-07-11 18:21:47 +0000
+++ t/pt-table-sync/columns.t 2014-04-23 12:01:14 +0000
@@ -28,7 +28,7 @@
28 plan skip_all => 'Cannot connect to sandbox slave';28 plan skip_all => 'Cannot connect to sandbox slave';
29}29}
30else {30else {
31 plan tests => 6;31 plan tests => 7;
32}32}
3333
34$sb->wipe_clean($master_dbh);34$sb->wipe_clean($master_dbh);
@@ -54,6 +54,11 @@
54$output = `$trunk/bin/pt-table-sync --ignore-columns name --print h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test3 t=test4`;54$output = `$trunk/bin/pt-table-sync --ignore-columns name --print h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test3 t=test4`;
55is($output, "", '--ignore-columns name: found no differences');55is($output, "", '--ignore-columns name: found no differences');
5656
57# bug https://bugs.launchpad.net/percona-toolkit/+bug/1311584
58# case sensitivity of --ignore-columns was broken.
59$output = `$trunk/bin/pt-table-sync --ignore-columns Name --print h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test5 t=test6`;
60is($output, "", '--ignore-columns Name (case sensitive): found no differences');
61
57$output = `$trunk/bin/pt-table-sync --ignore-columns id --print h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test3 t=test4`;62$output = `$trunk/bin/pt-table-sync --ignore-columns id --print h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test3 t=test4`;
58$output = remove_traces($output);63$output = remove_traces($output);
59# This test changed for the same reason as above.64# This test changed for the same reason as above.
6065
=== modified file 't/pt-table-sync/samples/before.sql'
--- t/pt-table-sync/samples/before.sql 2011-06-24 22:02:05 +0000
+++ t/pt-table-sync/samples/before.sql 2014-04-23 12:01:14 +0000
@@ -28,3 +28,16 @@
28);28);
29insert into test3(id, name) values(15034, '51707'),(1, '001');29insert into test3(id, name) values(15034, '51707'),(1, '001');
30insert into test4(id, name) values(15034, '051707'),(1, '1');30insert into test4(id, name) values(15034, '051707'),(1, '1');
31
32
33create table test5 (
34 id int not null primary key,
35 Name varchar(255)
36);
37insert into test5(id, Name) values(15034, 'master'),(1, '1');
38
39create table test6 (
40 id int not null primary key,
41 Name varchar(255)
42);
43insert into test6(id, Name) values(15034, 'slave'),(1, '1');

Subscribers

People subscribed via source and target branches