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>
This commit is contained in:
Martin Renvoize 2024-06-06 07:30:37 +01:00
parent dc2388281c
commit 73634e93fd
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
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