summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin McCorkell <robin@mccorkell.me.uk>2016-03-11 17:22:29 +0000
committerArthur Schiwon <blizzz@owncloud.com>2016-03-16 14:50:00 +0100
commitaa91d50d043df254403479aedfa0f7b4f7f76502 (patch)
treefc49cf337c11ffe12a7830f0c5f4b6d887f14278 /lib
parentd54106dadaeb84ad54c716111315db45ec202d0b (diff)
downloadnextcloud-server-aa91d50d043df254403479aedfa0f7b4f7f76502.tar.gz
nextcloud-server-aa91d50d043df254403479aedfa0f7b4f7f76502.zip
Prevent certain DBs throwing exceptions on same-value updates
A PreconditionNotMetException must only be thrown if explicit preconditions are specified for setValues(), not if the value is merely the same as was already in the DB.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/db/connection.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php
index 584904e6370..7904fab0726 100644
--- a/lib/private/db/connection.php
+++ b/lib/private/db/connection.php
@@ -293,7 +293,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
$updateQb->where($where);
$affected = $updateQb->execute();
- if ($affected === 0) {
+ if ($affected === 0 && !empty($updatePreconditionValues)) {
throw new PreconditionNotMetException();
}