From 1b2f1cc2720682b253891a03c05e225cc7ca8882 Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Fri, 11 Mar 2016 17:22:29 +0000 Subject: 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. --- lib/private/db/connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private') 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(); } -- cgit v1.2.3