Skip to content

Commit

Permalink
PT-2422 Fix unconstrained UPDATE to pt_osc_history table
Browse files Browse the repository at this point in the history
Ensure that entries in the history table are updated by job_id
instead of updating ALL instances of jobs in the history table.
  • Loading branch information
drwonky committed Jan 28, 2025
1 parent d82723f commit 9e9f743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/pt-online-schema-change
Original file line number Diff line number Diff line change
Expand Up @@ -9797,9 +9797,9 @@ sub main {

if ( $o->get('history') ) {
my $sth = $cxn->dbh()->prepare(
"UPDATE ${hist_table} SET new_table_name = ?"
"UPDATE ${hist_table} SET new_table_name = ? WHERE job_id = ?"
);
$sth->execute($new_tbl->{tbl});
$sth->execute($new_tbl->{tbl}, $job_id);
}

# If the new table still exists, drop it unless the tool was interrupted.
Expand Down

0 comments on commit 9e9f743

Please sign in to comment.