From 51e476c6a21a3db3bb7aa7a98a215bf714e13c6a Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Wed, 10 Jul 2013 10:23:28 -0700 Subject: [PATCH] Fix bug: a typo in NibbleIterator::_find_best_index(). --- lib/NibbleIterator.pm | 2 +- t/lib/NibbleIterator.t | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/NibbleIterator.pm b/lib/NibbleIterator.pm index 0d2c0898..61e2513f 100644 --- a/lib/NibbleIterator.pm +++ b/lib/NibbleIterator.pm @@ -554,7 +554,7 @@ sub _find_best_index { @possible_indexes = sort { # Prefer the index with the highest cardinality. my $cmp - = $indexes->{$b}->{cardinality} <=> $indexes->{$b}->{cardinality}; + = $indexes->{$b}->{cardinality} <=> $indexes->{$a}->{cardinality}; if ( $cmp == 0 ) { # Indexes have the same cardinality; prefer the one with # more columns. diff --git a/t/lib/NibbleIterator.t b/t/lib/NibbleIterator.t index d97e4339..701f2698 100644 --- a/t/lib/NibbleIterator.t +++ b/t/lib/NibbleIterator.t @@ -38,9 +38,6 @@ my $dbh = $sb->get_dbh_for('master'); if ( !$dbh ) { plan skip_all => 'Cannot connect to sandbox master'; } -else { - plan tests => 54; -} my $q = new Quoter(); my $tp = new TableParser(Quoter=>$q); @@ -866,4 +863,4 @@ like( ); $sb->wipe_clean($dbh); ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); -exit; +done_testing;