diff options
author | Joas Schilling <coding@schilljs.com> | 2017-07-20 20:13:35 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-08-02 09:48:12 +0200 |
commit | b29baababdbc56b1633eca2d8357dd6b87268050 (patch) | |
tree | 3859d0d4ca93c2570483c22462c9740b3502b983 /lib/private | |
parent | 2800e017dea5eb81590696101df1729a37c753ca (diff) | |
download | nextcloud-server-b29baababdbc56b1633eca2d8357dd6b87268050.tar.gz nextcloud-server-b29baababdbc56b1633eca2d8357dd6b87268050.zip |
Oracle does not support PDO::FETCH_KEY_PAIR
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Comments/Manager.php | 19 | ||||
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 7 |
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 4645adc6c5b..0c2a5efe601 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -411,9 +411,12 @@ class Manager implements ICommentsManager { */ public function getNumberOfUnreadCommentsForFolder($folderId, IUser $user) { $qb = $this->dbConn->getQueryBuilder(); - $query = $qb->select('fileid', $qb->createFunction( - 'COUNT(' . $qb->getColumnName('c.id') . ')') - )->from('comments', 'c') + $query = $qb->select('fileid') + ->selectAlias( + $qb->createFunction('COUNT(' . $qb->getColumnName('c.id') . ')'), + 'num_ids' + ) + ->from('comments', 'c') ->innerJoin('c', 'filecache', 'f', $qb->expr()->andX( $qb->expr()->eq('c.object_type', $qb->createNamedParameter('files')), $qb->expr()->eq('f.fileid', $qb->expr()->castColumn('c.object_id', IQueryBuilder::PARAM_INT)) @@ -431,9 +434,13 @@ class Manager implements ICommentsManager { ->groupBy('f.fileid'); $resultStatement = $query->execute(); - return array_map(function ($count) { - return (int)$count; - }, $resultStatement->fetchAll(\PDO::FETCH_KEY_PAIR)); + + $results = []; + while ($row = $resultStatement->fetch()) { + $results[$row['fileid']] = (int) $row['num_ids']; + } + $resultStatement->closeCursor(); + return $results; } /** diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 7ecad6e8cfb..9466aaf6c89 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -365,6 +365,11 @@ class UserMountCache implements IUserMountCache { $result = $query->execute(); - return $result->fetchAll(\PDO::FETCH_KEY_PAIR); + $results = []; + while ($row = $result->fetch()) { + $results[$row['user_id']] = $row['size']; + } + $result->closeCursor(); + return $results; } } |