Skip to content
Snippets Groups Projects
Unverified Commit 28d9ad28 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Empty string is null on oracle

parent 60225284
No related branches found
No related tags found
No related merge requests found
......@@ -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::%');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment