diff options
Diffstat (limited to 'lib/repair')
-rw-r--r-- | lib/repair/cleantags.php | 16 | ||||
-rw-r--r-- | lib/repair/filletags.php | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/repair/cleantags.php b/lib/repair/cleantags.php index ddd1a483016..2bda1047081 100644 --- a/lib/repair/cleantags.php +++ b/lib/repair/cleantags.php @@ -110,14 +110,14 @@ class CleanTags extends BasicEmitter implements RepairStep { protected function deleteOrphanEntries($repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { $qb = $this->connection->getQueryBuilder(); - $qb->select('d.`' . $deleteId . '`') - ->from('`' . $deleteTable . '`', 'd') - ->leftJoin('d', '`' . $sourceTable . '`', 's', 'd.`' . $deleteId . '` = s.`' . $sourceId . '`') + $qb->select('d.' . $deleteId) + ->from($deleteTable, 'd') + ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, ' s.' . $sourceId)) ->where( - 'd.`type` = ' . $qb->expr()->literal('files') + $qb->expr()->eq('d.type', $qb->expr()->literal('files')) ) ->andWhere( - $qb->expr()->isNull('s.`' . $sourceNullColumn . '`') + $qb->expr()->isNull('s.' . $sourceNullColumn) ); $result = $qb->execute(); @@ -129,11 +129,11 @@ class CleanTags extends BasicEmitter implements RepairStep { if (!empty($orphanItems)) { $orphanItemsBatch = array_chunk($orphanItems, 200); foreach ($orphanItemsBatch as $items) { - $qb->delete('`' . $deleteTable . '`') + $qb->delete($deleteTable) ->where( - '`type` = ' . $qb->expr()->literal('files') + $qb->expr()->eq('type', $qb->expr()->literal('files')) ) - ->andWhere($qb->expr()->in('`' . $deleteId . '`', ':ids')); + ->andWhere($qb->expr()->in($deleteId, $qb->createParameter('ids'))); $qb->setParameter('ids', $items, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY); $qb->execute(); } diff --git a/lib/repair/filletags.php b/lib/repair/filletags.php index a46c951efaf..f1bb2c896c4 100644 --- a/lib/repair/filletags.php +++ b/lib/repair/filletags.php @@ -42,10 +42,10 @@ class FillETags extends BasicEmitter implements \OC\RepairStep { public function run() { $qb = $this->connection->getQueryBuilder(); - $qb->update('`*PREFIX*filecache`') - ->set('`etag`', $qb->expr()->literal('xxx')) - ->where($qb->expr()->eq('`etag`', $qb->expr()->literal(''))) - ->orWhere($qb->expr()->isNull('`etag`')); + $qb->update('*PREFIX*filecache') + ->set('etag', $qb->expr()->literal('xxx')) + ->where($qb->expr()->eq('etag', $qb->expr()->literal(''))) + ->orWhere($qb->expr()->isNull('etag')); $result = $qb->execute(); $this->emit('\OC\Repair', 'info', array("ETags have been fixed for $result files/folders.")); |