diff options
author | Joas Schilling <coding@schilljs.com> | 2020-11-04 19:02:23 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-11-06 14:13:22 +0300 |
commit | 3c027bd0cf698ab573e4b92fbeeccd929c2beb19 (patch) | |
tree | 667e1dfffdd6c8e401038386aa2423ab92110696 /lib/private/Files/Cache/Propagator.php | |
parent | 2c6bbe783a6ab0f75f9ad85d66d9b4511a7543be (diff) |
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/private/Files/Cache/Propagator.php')
-rw-r--r-- | lib/private/Files/Cache/Propagator.php | 6 |
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))); |