mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-13 14:39:28 +00:00
Create NibbleIterator. Cleanup TableNibbler. Fix bug in SchemaIterator.
This commit is contained in:
@@ -65,28 +65,26 @@ sub generate_asc_stmt {
|
||||
die "I need a $arg argument" unless defined $args{$arg};
|
||||
}
|
||||
my ($tbl_struct, $index) = @args{@required_args};
|
||||
my @cols = $args{cols} ? @{$args{cols}} : @{$tbl_struct->{cols}};
|
||||
my @cols = $args{cols} ? @{$args{cols}} : @{$tbl_struct->{cols}};
|
||||
my $q = $self->{Quoter};
|
||||
|
||||
# This shouldn't happen. TableSyncNibble shouldn't call us with
|
||||
# a nonexistent index.
|
||||
die "Index '$index' does not exist in table"
|
||||
unless exists $tbl_struct->{keys}->{$index};
|
||||
|
||||
my @asc_cols = @{$tbl_struct->{keys}->{$index}->{cols}};
|
||||
my @asc_slice;
|
||||
MKDEBUG && _d('Will ascend index', $index);
|
||||
|
||||
# These are the columns we'll ascend.
|
||||
@asc_cols = @{$tbl_struct->{keys}->{$index}->{cols}};
|
||||
MKDEBUG && _d('Will ascend index', $index);
|
||||
MKDEBUG && _d('Will ascend columns', join(', ', @asc_cols));
|
||||
my @asc_cols = @{$tbl_struct->{keys}->{$index}->{cols}};
|
||||
if ( $args{asc_first} ) {
|
||||
@asc_cols = $asc_cols[0];
|
||||
MKDEBUG && _d('Ascending only first column');
|
||||
}
|
||||
MKDEBUG && _d('Will ascend columns', join(', ', @asc_cols));
|
||||
|
||||
# We found the columns by name, now find their positions for use as
|
||||
# array slices, and make sure they are included in the SELECT list.
|
||||
my @asc_slice;
|
||||
my %col_posn = do { my $i = 0; map { $_ => $i++ } @cols };
|
||||
foreach my $col ( @asc_cols ) {
|
||||
if ( !exists $col_posn{$col} ) {
|
||||
|
Reference in New Issue
Block a user