summaryrefslogtreecommitdiffstats
path: root/lib/private/Comments
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-03-29 17:47:27 +0200
committerRobin Appelman <robin@icewind.nl>2017-03-30 12:48:30 +0200
commit40154dd6a36bd052db6a0a6c9667bc915dfd5f87 (patch)
treebca848b33c78f5d07a165be4b2a617ae231db836 /lib/private/Comments
parent212d9fd2776c70b7b21fdea4e4e312530a0a3451 (diff)
downloadnextcloud-server-40154dd6a36bd052db6a0a6c9667bc915dfd5f87.tar.gz
nextcloud-server-40154dd6a36bd052db6a0a6c9667bc915dfd5f87.zip
use castColumn
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Comments')
-rw-r--r--lib/private/Comments/Manager.php5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 490b15120ef..695d209b68f 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -412,15 +412,12 @@ class Manager implements ICommentsManager {
*/
public function getNumberOfUnreadCommentsForFolder($folderId, IUser $user) {
$qb = $this->dbConn->getQueryBuilder();
- $castAs = ($this->dbConn->getDatabasePlatform() instanceof MySqlPlatform) ? 'unsigned integer' : 'int';
$query = $qb->select('fileid', $qb->createFunction(
'COUNT(' . $qb->getColumnName('c.id') . ')')
)->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->createFunction(
- 'cast(' . $qb->getColumnName('c.object_id') . ' as ' . $castAs . ')'
- ))
+ $qb->expr()->eq('f.fileid', $qb->expr()->castColumn('c.object_id', IQueryBuilder::PARAM_INT))
))
->leftJoin('c', 'comments_read_markers', 'm', $qb->expr()->andX(
$qb->expr()->eq('m.object_type', $qb->createNamedParameter('files')),