From 5807d286ed296f7d1c514105fe8cf91aa9eba2ca Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Mon, 4 May 2026 10:24:31 +0200 Subject: [PATCH] MT#64858 fix check balance record created by B node we cannot enforce READ COMMITTED with statement-based repl, as repl cannot lock lock transactions. therefore 27d39e5 introduced "insert IGNORE contract_balances" and a subsequent check for the number of modified rows, to see if the B node added records. there is a bug with that hwoever, since ->execute returns 0E0 if 0 rows affected, and the RESTART_BALANCE_CATCHUP is not entered. Change-Id: Ica862d2e15364e4d627b797cafa35f0be620bfeb (cherry picked from commit ef1ffede7ee188d9a42c25726143533eeb3e7177) (cherry picked from commit badf5cc3a74c923226830cafc7dc1326172227a9) --- rate-o-mat.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rate-o-mat.pl b/rate-o-mat.pl index 3896562..5c357b0 100755 --- a/rate-o-mat.pl +++ b/rate-o-mat.pl @@ -1660,8 +1660,9 @@ PREPARE_BALANCE_CATCHUP: ($last_cash_balance) x 2,$last_cash_balance_int,($last_free_balance) x 2,$last_free_balance_int, ((defined $underrun_profiles_time ? $underrun_profiles_time : 0)) x 2,((defined $underrun_lock_time ? $underrun_lock_time : 0)) x 2,$stime); push(@bind_parms,$etime) if defined $etime; - unless ($sth->execute(@bind_parms) - or FATAL "Error executing new contract balance statement: ".$sth->errstr) { + my $res = $sth->execute(@bind_parms); + FATAL "Error executing new contract balance statement: ".$sth->errstr unless defined $res; + unless ($res > 0) { $sth->finish; INFO "cash balance record ($contract_id, $stime) was created elsewhere, starting over"; goto RESTART_BALANCE_CATCHUP;