mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 23:45:44 +00:00
fixed pt-archiver row skipping on partitioned tables - 1376561
This commit is contained in:
@@ -5811,7 +5811,18 @@ sub main {
|
||||
$next_sql .= " AND $sel_stmt->{where}";
|
||||
}
|
||||
|
||||
# Obtain index cols so we can order them when ascending
|
||||
# this ensures returned sets are disjoint when ran on partitioned tables
|
||||
# issue 1376561
|
||||
my $index_cols;
|
||||
if ( $sel_stmt->{index}
|
||||
&& $src->{info}->{keys}->{$sel_stmt->{index}}->{cols}
|
||||
) {
|
||||
$index_cols = $src->{info}->{keys}->{$sel_stmt->{index}}->{colnames};
|
||||
}
|
||||
|
||||
foreach my $thing ( $first_sql, $next_sql ) {
|
||||
$thing .= " ORDER BY $index_cols " if $index_cols;
|
||||
$thing .= " LIMIT $limit";
|
||||
if ( $o->get('for-update') ) {
|
||||
$thing .= ' FOR UPDATE';
|
||||
|
Reference in New Issue
Block a user