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.
This commit is contained in:
Perry Harrington
2025-01-28 10:49:28 -08:00
parent d82723f272
commit 9e9f7434d1

View File

@@ -9797,9 +9797,9 @@ sub main {
if ( $o->get('history') ) { if ( $o->get('history') ) {
my $sth = $cxn->dbh()->prepare( 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. # If the new table still exists, drop it unless the tool was interrupted.