Comment 5 for bug 1004567

Revision history for this message
Baron Schwartz (baron-xaprb) wrote : Re: pt-heartbeat --update --replace is causing duplicate key errors

I believe the problem may be caused by this bit of code:

3586 my $row = $dbh->selectall_arrayref($sql);
3587 if ( scalar @$row == 0 ) {
3588 PTDEBUG && _d('No heartbeat row in table');
3589 if ( $o->get('insert-heartbeat-row') ) {
3590 my $sql = "INSERT INTO $db_tbl ($pk_col, ts) "
3591 . "VALUES ('$pk_val', NOW())";
3592 PTDEBUG && _d($sql);
3593 $dbh->do($sql);
3594 }

This doesn't respect the REPLACE options.