From d26bc6fba470d5e41a27758c650ef5314f2ae30b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 5 Jun 2024 18:10:33 +0100 Subject: [PATCH] Bug 36986L (follow-up) Ensure idempotency MySQL/MariaDB checks the primary key/unique constraint before WHERE clause when performing an UPDATE. As such, the lack of AutoLocation existing will not prevent a failure on a second run of the update. Signed-off-by: Martin Renvoize (cherry picked from commit dc2388281c8e0e9c11ee5829cf09b7737a2f1c6c) Signed-off-by: Fridolin Somers --- installer/data/mysql/db_revs/231200061.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/db_revs/231200061.pl b/installer/data/mysql/db_revs/231200061.pl index f029fafc21..c185876141 100755 --- a/installer/data/mysql/db_revs/231200061.pl +++ b/installer/data/mysql/db_revs/231200061.pl @@ -10,7 +10,7 @@ return { $dbh->do( q{ - UPDATE systempreferences SET variable = "StaffLoginRestrictLibraryByIP" + UPDATE IGNORE systempreferences SET variable = "StaffLoginRestrictLibraryByIP" WHERE variable = "AutoLocation" } ) == 1 @@ -18,7 +18,7 @@ return { $dbh->do( q{ - UPDATE systempreferences SET variable = "StaffLoginLibraryBasedOnIP" + UPDATE IGNORE systempreferences SET variable = "StaffLoginLibraryBasedOnIP" WHERE variable = "StaffLoginBranchBasedOnIP" } ) == 1 -- 2.39.5