mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
Fix for #897758
This commit is contained in:
@@ -303,7 +303,7 @@ sub calculate_chunks {
|
|||||||
# from the beginning of the last chunk to infinity, or to the max col
|
# from the beginning of the last chunk to infinity, or to the max col
|
||||||
# value if chunk_range is openclosed. If the chunk column is nullable,
|
# value if chunk_range is openclosed. If the chunk column is nullable,
|
||||||
# do NULL separately.
|
# do NULL separately.
|
||||||
my $chunk_range = lc $args{chunk_range} || 'open';
|
my $chunk_range = lc($args{chunk_range} || 'open');
|
||||||
my $nullable = $args{tbl_struct}->{is_nullable}->{$args{chunk_col}};
|
my $nullable = $args{tbl_struct}->{is_nullable}->{$args{chunk_col}};
|
||||||
pop @chunks;
|
pop @chunks;
|
||||||
if ( @chunks ) {
|
if ( @chunks ) {
|
||||||
|
@@ -26,7 +26,7 @@ if ( !$dbh ) {
|
|||||||
plan skip_all => 'Cannot connect to sandbox master';
|
plan skip_all => 'Cannot connect to sandbox master';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plan tests => 90;
|
plan tests => 91;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sb->create_dbs($dbh, ['test']);
|
$sb->create_dbs($dbh, ['test']);
|
||||||
@@ -1201,6 +1201,23 @@ is(
|
|||||||
"test.world_city.name chunks select exactly 4,079 rows"
|
"test.world_city.name chunks select exactly 4,079 rows"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# #############################################################################
|
||||||
|
# Issue Bug #897758: TableChunker dies from an uninit value
|
||||||
|
# #############################################################################
|
||||||
|
|
||||||
|
@chunks = $c->calculate_chunks(
|
||||||
|
dbh => $dbh,
|
||||||
|
db => 'test',
|
||||||
|
tbl => 'world_city',
|
||||||
|
tbl_struct => $t,
|
||||||
|
chunk_col => 'name',
|
||||||
|
chunk_size => 500,
|
||||||
|
%params,
|
||||||
|
chunk_range => undef,
|
||||||
|
);
|
||||||
|
|
||||||
|
ok( @chunks, "calculate_chunks picks a sane default for chunk_range" );
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 1182: mk-table-checksum not respecting chunk size
|
# Issue 1182: mk-table-checksum not respecting chunk size
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
Reference in New Issue
Block a user