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 <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dc2388281c
)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
6016d7eda6
commit
d26bc6fba4
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue