diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index c1cdcabd..c5ab5b15 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -5132,12 +5132,12 @@ sub main { # https://bugs.launchpad.net/percona-toolkit/+bug/1010232 my ($chunk_index, $n_chunk_index_cols) = split(':', $o->get('chunk-index') || ''); - if ( defined $chunk_index && !$chunk_index ) { + if ( defined $chunk_index && $chunk_index eq '' ) { $o->save_error('--chunk-index cannot be an empty string'); } if ( defined $n_chunk_index_cols && (!$n_chunk_index_cols - || $n_chunk_index_cols =~ m/[^\d]/ + || $n_chunk_index_cols =~ m/\D/ || $n_chunk_index_cols < 1) ) { $o->save_error('Invalid number of --chunk-index columns: ' . $n_chunk_index_cols); diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 12b4b8a1..fe47c042 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -6093,12 +6093,12 @@ sub main { # https://bugs.launchpad.net/percona-toolkit/+bug/1010232 my ($chunk_index, $n_chunk_index_cols) = split(':', $o->get('chunk-index') || ''); - if ( defined $chunk_index && !$chunk_index ) { + if ( defined $chunk_index && $chunk_index eq '' ) { $o->save_error('--chunk-index cannot be an empty string'); } if ( defined $n_chunk_index_cols && (!$n_chunk_index_cols - || $n_chunk_index_cols =~ m/[^\d]/ + || $n_chunk_index_cols =~ m/\D/ || $n_chunk_index_cols < 1) ) { $o->save_error('Invalid number of --chunk-index columns: ' . $n_chunk_index_cols);