From 0e805d53105397aa8edbe4aab53eddc6af359275 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 11 Sep 2015 12:11:40 +0200 Subject: [PATCH] Do not compare the value on Oracle As per docs: http://docs.oracle.com/cd/E11882_01/server.112/e26088/conditions002.htm#i1033286 > Large objects (LOBs) are not supported in comparison conditions. --- lib/private/appconfig.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index 7ee64980fd..cf2a057f22 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -175,11 +175,21 @@ class AppConfig implements IAppConfig { ->set('configvalue', $sql->createParameter('configvalue')) ->where($sql->expr()->eq('appid', $sql->createParameter('app'))) ->andWhere($sql->expr()->eq('configkey', $sql->createParameter('configkey'))) - ->andWhere($sql->expr()->neq('configvalue', $sql->createParameter('configvalue'))) ->setParameter('configvalue', $value) ->setParameter('app', $app) - ->setParameter('configkey', $key) - ->setParameter('configvalue', $value); + ->setParameter('configkey', $key); + + /* + * Only limit to the existing value for non-Oracle DBs: + * http://docs.oracle.com/cd/E11882_01/server.112/e26088/conditions002.htm#i1033286 + * > Large objects (LOBs) are not supported in comparison conditions. + */ + if (!($this->conn instanceof \OC\DB\OracleConnection)) { + // Only update the value when it is not the same + $sql->andWhere($sql->expr()->neq('configvalue', $sql->createParameter('configvalue'))) + ->setParameter('configvalue', $value); + } + $changedRow = (bool) $sql->execute(); $this->cache[$app][$key] = $value;