Merge pull request #18973 from owncloud/try-fixing-app-config-on-oracle
Do not compare the value on Oracle
This commit is contained in:
commit
fb9e75edb6
|
@ -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('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;
|
||||
|
|
|
@ -191,7 +191,10 @@ class AppConfig extends TestCase {
|
|||
$this->assertEquals('1.2.3', $config->getValue('testapp', 'installed_version'));
|
||||
$this->assertConfigKey('testapp', 'installed_version', '1.2.3');
|
||||
|
||||
$this->assertFalse($config->setValue('testapp', 'installed_version', '1.2.3'));
|
||||
$wasModified = $config->setValue('testapp', 'installed_version', '1.2.3');
|
||||
if (!(\OC::$server->getDatabaseConnection() instanceof \OC\DB\OracleConnection)) {
|
||||
$this->assertFalse($wasModified);
|
||||
}
|
||||
|
||||
$this->assertEquals('1.2.3', $config->getValue('testapp', 'installed_version'));
|
||||
$this->assertConfigKey('testapp', 'installed_version', '1.2.3');
|
||||
|
@ -218,7 +221,10 @@ class AppConfig extends TestCase {
|
|||
$this->assertEquals('somevalue', $config->getValue('someapp', 'somekey'));
|
||||
$this->assertConfigKey('someapp', 'somekey', 'somevalue');
|
||||
|
||||
$this->assertFalse($config->setValue('someapp', 'somekey', 'somevalue'));
|
||||
$wasInserted = $config->setValue('someapp', 'somekey', 'somevalue');
|
||||
if (!(\OC::$server->getDatabaseConnection() instanceof \OC\DB\OracleConnection)) {
|
||||
$this->assertFalse($wasInserted);
|
||||
}
|
||||
}
|
||||
|
||||
public function testDeleteKey() {
|
||||
|
|
Loading…
Reference in New Issue