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 <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 73634e93fd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Martin Renvoize 2024-06-06 07:30:37 +01:00 committed by Fridolin Somers
parent d26bc6fba4
commit 3f1c548ee0
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ return {
$dbh->do(
q{
UPDATE systempreferences SET variable = "StaffLoginLibraryBasedOnIP"
UPDATE IGNORE systempreferences SET variable = "StaffLoginLibraryBasedOnIP"
WHERE variable = "StaffLoginBranchBasedOnIP"
}
) == 1