Fix for the first bug in 1034717: Illegal division by zero if base == 1

This commit is contained in:
Brian Fraser
2012-08-22 17:03:35 -03:00
parent 250847455d
commit d3eabbd511
4 changed files with 71 additions and 4 deletions

View File

@@ -3927,6 +3927,12 @@ sub _chunk_char {
}
PTDEBUG && _d("Base", $base, "chars:", @chars);
die "Cannot chunk table $db_tbl using the character column "
. "$chunk_col, most likely because all values start with the "
. "same character. This table must be synced separately by "
. "specifying a list of --algorithms without the Chunk algorithm"
if $base == 1;
$sql = "SELECT MAX(LENGTH($qchunk_col)) FROM $db_tbl "
. ($args{where} ? "WHERE $args{where} " : "")
@@ -10198,6 +10204,10 @@ primary key columns and a checksum are sent over the network, not the entire
row. If a row is found to be different, the entire row will be fetched, but not
before.
Note that this algorithm will not work if chunking a char column where all
the values start with the same character. In that case, the tool will exit
and suggest picking a different algorithm.
=item Nibble
Finds an index and ascends the index in fixed-size nibbles of L<"--chunk-size">