mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-24 02:01:42 +08:00
Allow initial values to be zero for ReplicaLagLimiter::new(). Return 1/0/death from ReplicaLagLimiter::wait().
This commit is contained in:
@@ -38,7 +38,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 20;
|
||||
plan tests => 21;
|
||||
}
|
||||
|
||||
my $q = new Quoter();
|
||||
@@ -447,6 +447,27 @@ is_deeply(
|
||||
"Change chunk size while nibbling"
|
||||
) or print STDERR Dumper(\@rows);
|
||||
|
||||
# ############################################################################
|
||||
# Nibble one row at a time.
|
||||
# ############################################################################
|
||||
$ni = make_nibble_iter(
|
||||
sql_file => "a-z.sql",
|
||||
db => 'test',
|
||||
tbl => 't',
|
||||
argv => [qw(--databases test --chunk-size 1)],
|
||||
);
|
||||
|
||||
@rows = ();
|
||||
while (my $row = $ni->next()) {
|
||||
push @rows, @$row;
|
||||
}
|
||||
|
||||
is_deeply(
|
||||
\@rows,
|
||||
[ ('a'..'z') ],
|
||||
"Nibble by 1 row"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
||||
Reference in New Issue
Block a user