From 5a34a0817e32499770d78bc47e94367623ad1a89 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Thu, 28 Feb 2013 19:26:04 -0700 Subject: [PATCH] Fix bug 968596: rename NibbleIterator::chunk_size() to limit() and update ptc and pt-osc. --- bin/pt-online-schema-change | 8 ++++---- bin/pt-table-checksum | 6 +++--- lib/NibbleIterator.pm | 4 ++-- t/lib/NibbleIterator.t | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 00b8deab..f057bedc 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -5279,9 +5279,9 @@ sub one_nibble { return $self->{one_nibble}; } -sub chunk_size { +sub limit { my ($self) = @_; - return $self->{limit} + 1; + return $self->{limit}; } sub set_chunk_size { @@ -8594,7 +8594,7 @@ sub main { my $expl = explain_statement( tbl => $tbl, sth => $sth->{explain_upper_boundary}, - vals => [ @{$boundary->{lower}}, $nibble_iter->chunk_size() ], + vals => [ @{$boundary->{lower}}, $nibble_iter->limit() ], ); if (lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '')) { my $msg @@ -8609,7 +8609,7 @@ sub main { . $sth->{upper_boundary}->{Statement} . " with values " . join(", ", map { defined $_ ? $_ : "NULL" } - (@{$boundary->{lower}}, $nibble_iter->chunk_size())) + (@{$boundary->{lower}}, $nibble_iter->limit())) . "\n"; die $msg; } diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index f6741552..9982e731 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -6055,9 +6055,9 @@ sub one_nibble { return $self->{one_nibble}; } -sub chunk_size { +sub limit { my ($self) = @_; - return $self->{limit} + 1; + return $self->{limit}; } sub set_chunk_size { @@ -9533,7 +9533,7 @@ sub main { my $expl = explain_statement( tbl => $tbl, sth => $sth->{explain_upper_boundary}, - vals => [ @{$boundary->{lower}}, $nibble_iter->chunk_size() ], + vals => [ @{$boundary->{lower}}, $nibble_iter->limit() ], ); if ( lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') ) { diff --git a/lib/NibbleIterator.pm b/lib/NibbleIterator.pm index 7edabdc3..0d2c0898 100644 --- a/lib/NibbleIterator.pm +++ b/lib/NibbleIterator.pm @@ -405,9 +405,9 @@ sub one_nibble { return $self->{one_nibble}; } -sub chunk_size { +sub limit { my ($self) = @_; - return $self->{limit} + 1; + return $self->{limit}; } sub set_chunk_size { diff --git a/t/lib/NibbleIterator.t b/t/lib/NibbleIterator.t index 76075167..eef3c7d0 100644 --- a/t/lib/NibbleIterator.t +++ b/t/lib/NibbleIterator.t @@ -206,9 +206,9 @@ ok( ); is( - $ni->chunk_size(), - 5, - "chunk_size()" + $ni->limit(), + 4, + "limit()" ); # ############################################################################