mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
PT-1554 Updated pt-table-checksum var type
In different OSes, using BIGINT to store the checksum for a query, will produce collisions and/or unstable values. Because of this, I changed the type for the checksum field in the history table from BIGINT to CHAR(32) and the checksum function is no longer truncating the MD5_HEX result to 16 chars.
This commit is contained in:
@@ -2679,8 +2679,7 @@ sub any_unix_timestamp {
|
||||
|
||||
sub make_checksum {
|
||||
my ( $val ) = @_;
|
||||
my $checksum = uc substr(md5_hex($val), -16);
|
||||
warn ($checksum, ' checksum for ', $val);
|
||||
my $checksum = uc md5_hex($val);
|
||||
PTDEBUG && _d($checksum, 'checksum for', $val);
|
||||
return $checksum;
|
||||
}
|
||||
@@ -16189,7 +16188,7 @@ by pt-query-digest.
|
||||
MAGIC_create_review_table:
|
||||
|
||||
CREATE TABLE IF NOT EXISTS query_review (
|
||||
checksum BIGINT UNSIGNED NOT NULL PRIMARY KEY,
|
||||
checksum CHAR(32) NOT NULL PRIMARY KEY,
|
||||
fingerprint TEXT NOT NULL,
|
||||
sample TEXT NOT NULL,
|
||||
first_seen DATETIME,
|
||||
|
Reference in New Issue
Block a user