diff options
author | Robin Appelman <robin@icewind.nl> | 2017-03-29 17:47:27 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-03-30 12:48:30 +0200 |
commit | 40154dd6a36bd052db6a0a6c9667bc915dfd5f87 (patch) | |
tree | bca848b33c78f5d07a165be4b2a617ae231db836 /lib/private/Comments | |
parent | 212d9fd2776c70b7b21fdea4e4e312530a0a3451 (diff) | |
download | nextcloud-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.php | 5 |
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')), |