Skip to content
Snippets Groups Projects
Unverified Commit 4c7bd11f authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

for the DB ot pick an index specify the object_type

parent 8fcd1d14
No related branches found
No related tags found
No related merge requests found
...@@ -601,11 +601,13 @@ class Manager implements ICommentsManager { ...@@ -601,11 +601,13 @@ class Manager implements ICommentsManager {
$query = $qb->select('f.fileid') $query = $qb->select('f.fileid')
->addSelect($qb->func()->count('c.id', 'num_ids')) ->addSelect($qb->func()->count('c.id', 'num_ids'))
->from('filecache', 'f') ->from('filecache', 'f')
->leftJoin('f', 'comments', 'c', $qb->expr()->eq( ->leftJoin('f', 'comments', 'c', $qb->expr()->andX(
'f.fileid', $qb->expr()->castColumn('c.object_id', IQueryBuilder::PARAM_INT) $qb->expr()->eq('f.fileid', $qb->expr()->castColumn('c.object_id', IQueryBuilder::PARAM_INT)),
$qb->expr()->eq('c.object_type', $qb->createNamedParameter('files'))
)) ))
->leftJoin('c', 'comments_read_markers', 'm', $qb->expr()->eq( ->leftJoin('c', 'comments_read_markers', 'm', $qb->expr()->andX(
'c.object_id', 'm.object_id' $qb->expr()->eq('c.object_id', 'm.object_id'),
$qb->expr()->eq('m.object_type', $qb->createNamedParameter('files'))
)) ))
->where( ->where(
$qb->expr()->andX( $qb->expr()->andX(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment