Merge pull request #941 from percona/PT-2355_pt-online-schema-change_should_not_resume_a_job_with_empty_boundaries

PT-2355 - pt-online-schema-change should not resume a job with empty …
This commit is contained in:
Sveta Smirnova
2025-03-27 21:13:43 +03:00
committed by GitHub
2 changed files with 248 additions and 1 deletions

View File

@@ -8943,12 +8943,20 @@ sub main {
$sth->finish();
PTDEBUG && _d('Last chunk:', Dumper($last_chunk));
if ( !$last_chunk || !$last_chunk->{new_table_name} ) {
if ( !$last_chunk ) {
$oktorun = undef;
_die("Option --resume refers non-existing job ID: ${old_job_id}. Exiting."
, UNSUPPORTED_OPERATION);
}
if ( !$last_chunk->{new_table_name}
|| !$last_chunk->{lower_boundary}
|| !$last_chunk->{upper_boundary} ) {
$oktorun = undef;
_die("Option --resume refers job ${old_job_id} with empty boundaries. Exiting."
, UNSUPPORTED_OPERATION);
}
if ( $last_chunk->{db} ne $db
|| $last_chunk->{tbl} ne $tbl
|| $last_chunk->{altr} ne $o->get('alter') ){