Empty string is null on oracle

This commit is contained in:
Roeland Jago Douma 2016-06-03 14:43:31 +02:00 committed by Roeland Jago Douma
parent 60225284f3
commit 28d9ad2817
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 9 additions and 1 deletions

View 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::%');