This commit is contained in:
Brian Fraser
2012-01-31 13:15:15 -03:00
parent 0a81ddeaad
commit 807dbcfe21
2 changed files with 19 additions and 2 deletions

View File

@@ -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 ) {

View File

@@ -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
# ############################################################################# # #############################################################################