diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-07 22:08:21 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-21 15:25:47 +0200 |
commit | f77e5f411dda91a7c4fc70c090825a036b7b1135 (patch) | |
tree | 6cc6cc88d7f3bb3ff137e2da5130e933ca1ab840 /lib/repair | |
parent | 516f7e8299c309ed909259c90c23cb0ce6a8e4f7 (diff) | |
download | nextcloud-server-f77e5f411dda91a7c4fc70c090825a036b7b1135.tar.gz nextcloud-server-f77e5f411dda91a7c4fc70c090825a036b7b1135.zip |
Fix existing usages by removing the quotes
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.")); |