diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index bad2d08e..bd11dc66 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -5287,6 +5287,7 @@ sub _get_hash_func { if ( $EVAL_ERROR && $EVAL_ERROR =~ m/failed: (.*?) at \S+ line/ ) { $error .= qq{$func cannot be used because "$1"\n}; PTDEBUG && _d($func, 'cannot be used because', $1); + next; } PTDEBUG && _d('Chosen hash func:', $result); return $func; diff --git a/lib/RowChecksum.pm b/lib/RowChecksum.pm index cda58eda..3bdd0b66 100644 --- a/lib/RowChecksum.pm +++ b/lib/RowChecksum.pm @@ -290,6 +290,7 @@ sub _get_hash_func { if ( $EVAL_ERROR && $EVAL_ERROR =~ m/failed: (.*?) at \S+ line/ ) { $error .= qq{$func cannot be used because "$1"\n}; PTDEBUG && _d($func, 'cannot be used because', $1); + next; } PTDEBUG && _d('Chosen hash func:', $result); return $func; diff --git a/t/lib/RowChecksum.t b/t/lib/RowChecksum.t index b9ce389c..3ef193ea 100644 --- a/t/lib/RowChecksum.t +++ b/t/lib/RowChecksum.t @@ -461,6 +461,22 @@ like( 'Dies if all columns are ignored by --columns' ); +# ############################################################################# +# pt-table-checksum doesn't test all hash functions +# https://bugs.launchpad.net/percona-toolkit/+bug/1059732 +# ############################################################################# + +@ARGV = qw(--function FALSEFUNC); +$o->get_opts(); + +unlike( + $c->_get_hash_func( + dbh => $dbh, + ), + qr/FALSEFUNC/, + "_get_hash_func doesn't return failed functions", +); + # ############################################################################ # Done. # ############################################################################