User tests: Successful: Unsuccessful:
Labels |
Added:
?
|
The part with $query2 doesn't make any sense to me. Leftover from testing?
Hello, I rechecked it, and with the solution from #5009 it is obsolete, you are right.
Before it made sense, because in postgres to original database query looked like that:
For the starting page with Offset 0:
SELECT COUNT(*) FROM #__content AS a LEFT JOIN #__content_frontpage AS fp ON fp.content_id = a.id LEFT JOIN #__categories AS c ON c.id = a.catid LEFT JOIN #__users AS ua ON ua.id = a.created_by LEFT JOIN #__users AS uam ON uam.id = a.modified_by LEFT JOIN #__categories as parent ON parent.id = c.parent_id LEFT JOIN #__content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id WHERE a.access IN (1,1,5) AND c.access IN (1,1,5) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.catid = 13 OR a.catid IN ( SELECT sub.id FROM #__categories as sub INNER JOIN #__categories as this ON sub.lft > this.lft AND sub.rgt < this.rgt WHERE this.id = 13)) AND (a.publish_up = '1970-01-01 00:00:00' OR a.publish_up <= '2014-11-07 14:49:04') AND (a.publish_down = '1970-01-01 00:00:00' OR a.publish_down >= '2014-11-07 14:49:04')
For example with offset 4:
SELECT COUNT(*) FROM #__content AS a LEFT JOIN #__content_frontpage AS fp ON fp.content_id = a.id LEFT JOIN #__categories AS c ON c.id = a.catid LEFT JOIN #__users AS ua ON ua.id = a.created_by LEFT JOIN #__users AS uam ON uam.id = a.modified_by LEFT JOIN #__categories as parent ON parent.id = c.parent_id LEFT JOIN #__content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id WHERE a.access IN (1,1,5) AND c.access IN (1,1,5) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.catid = 13 OR a.catid IN ( SELECT sub.id FROM #__categories as sub INNER JOIN #__categories as this ON sub.lft > this.lft AND sub.rgt < this.rgt WHERE this.id = 13)) AND (a.publish_up = '1970-01-01 00:00:00' OR a.publish_up <= '2014-11-07 14:49:17') AND (a.publish_down = '1970-01-01 00:00:00' OR a.publish_down >= '2014-11-07 14:49:17') OFFSET 4
the first statement returns a value for Count(), the second on returns nothing. Therefore there was my workaround with the encapsuled query so that the count() is working proberly again in postgres.
But as stated above, with the change in #5009 and eliminating the offset you don't need it any more.
So I'm closing this based on your comment
Title |
|
||||||
Status | Pending | ⇒ | Closed | ||||
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-07 15:28:41 |
See comment on #5010