mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
normalize timestamp data on servers with different tz - 1388870
This commit is contained in:
@@ -82,10 +82,10 @@ sub make_row_checksum {
|
||||
$query = join(', ',
|
||||
map {
|
||||
my $col = $_;
|
||||
if ( $col =~ m/\+ 0/ ) {
|
||||
if ( $col =~ m/UNIX_TIMESTAMP/ ) {
|
||||
# Alias col name back to itself else its name becomes
|
||||
# "col + 0" instead of just "col".
|
||||
my ($real_col) = /^(\S+)/;
|
||||
my ($real_col) = /^UNIX_TIMESTAMP\((.+?)\)/;
|
||||
$col .= " AS $real_col";
|
||||
}
|
||||
elsif ( $col =~ m/TRIM/ ) {
|
||||
@@ -216,7 +216,7 @@ sub get_checksum_columns {
|
||||
my $type = $tbl_struct->{type_for}->{$_};
|
||||
my $result = $q->quote($_);
|
||||
if ( $type eq 'timestamp' ) {
|
||||
$result .= ' + 0';
|
||||
$result = "UNIX_TIMESTAMP($result)";
|
||||
}
|
||||
elsif ( $float_precision && $type =~ m/float|double/ ) {
|
||||
$result = "ROUND($result, $float_precision)";
|
||||
|
Reference in New Issue
Block a user