From 6d1b3cf2120fbd2c9beb4317797c260d9b647f79 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 22 Oct 2019 12:29:40 +0000 Subject: [PATCH] Bug 23867: Resolve "truncated incorrect double" for empty string Updatedatabase, rev. 18.12.00.051 Solved by testing the value of the pref first. Tested by copying the change in a new atomic update with XXX. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- installer/data/mysql/updatedatabase.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index cf00117a53..765fa77178 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18077,7 +18077,8 @@ VALUES $DBversion = '18.12.00.051'; if( CheckVersion( $DBversion ) ) { - $dbh->do( "UPDATE borrowers SET login_attempts = ? WHERE login_attempts > ?", undef, C4::Context->preference('FailedLoginAttempts'), C4::Context->preference('FailedLoginAttempts') ); + my $failed_attempts = C4::Context->preference('FailedLoginAttempts'); + $dbh->do( "UPDATE borrowers SET login_attempts = ? WHERE login_attempts > ?", undef, $failed_attempts, $failed_attempts ) if $failed_attempts && $failed_attempts > 0; SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 21336 - Reset login_attempts)\n"; } -- 2.39.5