summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-11-04 17:02:23 +0100
committerJoas Schilling <coding@schilljs.com>2020-11-06 12:13:22 +0100
commit3c027bd0cf698ab573e4b92fbeeccd929c2beb19 (patch)
tree667e1dfffdd6c8e401038386aa2423ab92110696 /lib
parent2c6bbe783a6ab0f75f9ad85d66d9b4511a7543be (diff)
downloadnextcloud-server-3c027bd0cf698ab573e4b92fbeeccd929c2beb19.tar.gz
nextcloud-server-3c027bd0cf698ab573e4b92fbeeccd929c2beb19.zip
Fix order of GREATEST for Oracle
As per https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions060.htm Oracle uses the first value to cast the rest or the values. So when the first value is a plain int, instead of doing the math, it will cast the expression to int and continue with a potential 0. Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Propagator.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php
index c9200d33b11..53e56c37735 100644
--- a/lib/private/Files/Cache/Propagator.php
+++ b/lib/private/Files/Cache/Propagator.php
@@ -104,9 +104,9 @@ class Propagator implements IPropagator {
$builder = $this->connection->getQueryBuilder();
$builder->update('filecache')
->set('size', $builder->func()->greatest(
- $builder->createNamedParameter(-1, IQueryBuilder::PARAM_INT),
- $builder->func()->add('size', $builder->createNamedParameter($sizeDifference)))
- )
+ $builder->func()->add('size', $builder->createNamedParameter($sizeDifference)),
+ $builder->createNamedParameter(-1, IQueryBuilder::PARAM_INT)
+ ))
->where($builder->expr()->eq('storage', $builder->createNamedParameter($storageId, IQueryBuilder::PARAM_INT)))
->andWhere($builder->expr()->in('path_hash', $hashParams))
->andWhere($builder->expr()->gt('size', $builder->expr()->literal(-1, IQueryBuilder::PARAM_INT)));