Skip to content

Commit 9e9f743

Browse files
committed
PT-2422 Fix unconstrained UPDATE to pt_osc_history table
Ensure that entries in the history table are updated by job_id instead of updating ALL instances of jobs in the history table.
1 parent d82723f commit 9e9f743

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/pt-online-schema-change

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9797,9 +9797,9 @@ sub main {
97979797

97989798
if ( $o->get('history') ) {
97999799
my $sth = $cxn->dbh()->prepare(
9800-
"UPDATE ${hist_table} SET new_table_name = ?"
9800+
"UPDATE ${hist_table} SET new_table_name = ? WHERE job_id = ?"
98019801
);
9802-
$sth->execute($new_tbl->{tbl});
9802+
$sth->execute($new_tbl->{tbl}, $job_id);
98039803
}
98049804

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

0 commit comments

Comments
 (0)