]> source.dussan.org Git - nextcloud-server.git/commitdiff
Empty string is null on oracle
authorRoeland Jago Douma <rullzer@owncloud.com>
Fri, 3 Jun 2016 12:43:31 +0000 (14:43 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 10 Jun 2016 10:44:49 +0000 (12:44 +0200)
lib/private/Repair/AvatarPermissions.php

index 1d96a79ac1fca6416d04f3a16ee549480e944e26..d23479f5ba8f921cc5ab689b31eb0c9bf4353d97 100644 (file)
@@ -20,6 +20,7 @@
  */
 namespace OC\Repair;
 
+use Doctrine\DBAL\Platforms\OraclePlatform;
 use OCP\IDBConnection;
 use OCP\Migration\IOutput;
 use OCP\Migration\IRepairStep;
@@ -71,9 +72,16 @@ class AvatarPermissions implements IRepairStep {
                        ->from('storages')
                        ->where($qb->expr()->like('id', $qb2->createParameter('like')));
 
+               if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
+                       // '' is null on oracle
+                       $path = $qb2->expr()->isNull('path');
+               } else {
+                       $path = $qb2->expr()->eq('path', $qb2->createNamedParameter(''));
+               }
+
                $qb2->update('filecache')
                        ->set('permissions', $qb2->createNamedParameter(23))
-                       ->where($qb2->expr()->eq('path', $qb2->createNamedParameter('')))
+                       ->where($path)
                        ->andWhere($qb2->expr()->in('storage', $qb2->createFunction($qb->getSQL())))
                        ->andWhere($qb2->expr()->neq('permissions', $qb2->createNamedParameter(23)))
                        ->setParameter('like', 'home::%');