diff options
author | Robin McCorkell <robin@mccorkell.me.uk> | 2016-03-11 17:22:29 +0000 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-03-15 13:02:19 +0100 |
commit | 1b2f1cc2720682b253891a03c05e225cc7ca8882 (patch) | |
tree | 09b3e850046b6c47e40f97e3ba7074ee228731c0 /lib/private/db | |
parent | ad9a0804f3a40123ce931f6f7f365758fe8a0933 (diff) | |
download | nextcloud-server-1b2f1cc2720682b253891a03c05e225cc7ca8882.tar.gz nextcloud-server-1b2f1cc2720682b253891a03c05e225cc7ca8882.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/private/db')
-rw-r--r-- | lib/private/db/connection.php | 2 |
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(); } |