mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-19 01:09:21 +08:00
PT-1574 Fixed undefs handling
This commit is contained in:
@@ -5690,7 +5690,7 @@ sub next {
|
||||
if ( !$self->{have_rows} ) {
|
||||
$self->{nibbleno}++;
|
||||
PTDEBUG && _d('Nibble:', $self->{nibble_sth}->{Statement}, 'params:',
|
||||
join(', ', (@{$self->{lower} || []}, @{$self->{upper} || []})));
|
||||
join(', ', (@{$self->{lower}} || [], @{$self->{upper} }||[])));
|
||||
if ( my $callback = $self->{callbacks}->{exec_nibble} ) {
|
||||
$self->{have_rows} = $callback->(%callback_args);
|
||||
}
|
||||
@@ -6089,7 +6089,7 @@ sub _next_boundaries {
|
||||
|
||||
|
||||
PTDEBUG && _d($self->{ub_sth}->{Statement}, 'params:',
|
||||
join(', ', @{$self->{lower}}), $self->{limit});
|
||||
join(', ', @{$self->{lower}} || []), $self->{limit});
|
||||
$self->{ub_sth}->execute(@{$self->{lower}}, $self->{limit});
|
||||
my $boundary = $self->{ub_sth}->fetchall_arrayref();
|
||||
PTDEBUG && _d('Next boundary:', Dumper($boundary));
|
||||
@@ -6130,6 +6130,9 @@ sub identical_boundaries {
|
||||
if scalar @$b1 != scalar @$b2; # shouldn't happen
|
||||
my $n_vals = scalar @$b1;
|
||||
for my $i ( 0..($n_vals-1) ) {
|
||||
next if (!defined($b1->[$i]) && !defined($b2->[$i]));
|
||||
return 0 if (!defined($b1->[$i]) && defined($b2->[$i])); # diff
|
||||
return 0 if (defined($b1->[$i]) && !defined($b2->[$i])); # diff
|
||||
return 0 if $b1->[$i] ne $b2->[$i]; # diff
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -53,6 +53,9 @@ $sb->load_file('master', "t/pt-online-schema-change/samples/pt-1574.sql");
|
||||
stderr => 1,
|
||||
);
|
||||
|
||||
my $sql_mode = $dbh->selectcol_arrayref('SELECT @@sql_mode');
|
||||
warn Data::Dumper::Dumper($sql_mode);
|
||||
|
||||
isnt(
|
||||
$exit_status,
|
||||
0,
|
||||
|
||||
@@ -22,12 +22,13 @@ INSERT INTO `test`.`t1` VALUES
|
||||
(NULL,NULL,NULL);
|
||||
|
||||
|
||||
CREATE TABLE `test`.`t2` (
|
||||
`id` int(11) DEFAULT NULL,
|
||||
`site_name` varchar(25) PRIMARY KEY,
|
||||
`last_update` datetime DEFAULT NULL,
|
||||
UNIQUE KEY `idx_id` (`id`),
|
||||
KEY `idx_last_update` (`last_update`)
|
||||
CREATE TABLE `t2` (
|
||||
`id` int(11) DEFAULT NULL,
|
||||
`site_name` varchar(25) NOT NULL,
|
||||
`last_update` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`site_name`),
|
||||
UNIQUE KEY `idx_id` (`id`),
|
||||
KEY `idx_last_update` (`last_update`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
INSERT INTO `test`.`t2` VALUES
|
||||
|
||||
Reference in New Issue
Block a user