From cad1935c7da2081d05dc560ee76550164c8e466f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 6 Jun 2024 07:30:37 +0100 Subject: [PATCH] Bug 36986: (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 73634e93fd044d68e6415601ebeab7dbcca5286e) Signed-off-by: Fridolin Somers --- installer/data/mysql/db_revs/231105010.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/data/mysql/db_revs/231105010.pl b/installer/data/mysql/db_revs/231105010.pl index 1c9d611d20..a0e8f23122 100755 --- a/installer/data/mysql/db_revs/231105010.pl +++ b/installer/data/mysql/db_revs/231105010.pl @@ -10,7 +10,7 @@ return { $dbh->do( q{ - UPDATE systempreferences SET variable = "StaffLoginLibraryBasedOnIP" + UPDATE IGNORE systempreferences SET variable = "StaffLoginLibraryBasedOnIP" WHERE variable = "StaffLoginBranchBasedOnIP" } ) == 1 -- 2.39.5