From 28d9ad2817b744bcef35a9259f65eb56b0b2ae78 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 3 Jun 2016 14:43:31 +0200 Subject: [PATCH] Empty string is null on oracle --- lib/private/Repair/AvatarPermissions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/private/Repair/AvatarPermissions.php b/lib/private/Repair/AvatarPermissions.php index 1d96a79ac1f..d23479f5ba8 100644 --- a/lib/private/Repair/AvatarPermissions.php +++ b/lib/private/Repair/AvatarPermissions.php @@ -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::%'); -- 2.39.5