Issue Type: Bug Created: 2008-08-24T14:37:15.000+0000 Last Updated: 2008-10-10T19:30:23.000+0000 Status: Resolved Fix version(s): Reporter: Jurrien Stutterheim (norm2782) Assignee: Jurrien Stutterheim (norm2782) Tags: - Zend_Paginator
Related issues: - ZF-3809
Attachments:
See http://ajaxray.com/blog/2008/… for details. This might already be fixed.
Posted by Jurrien Stutterheim (norm2782) on 2008-09-18T06:29:52.000+0000
The query described in the blogpost will generate a query similar to this one:
<pre class="highlight">
SELECT count(c.id) AS "total_comments", count(v.id) AS "total_votes" FROM "comments" AS "c" LEFT JOIN "votes" AS "v" ON delas.id = v.deal_id GROUP BY "foo"."id"
As far as I can see there is no sane reason for anyone to paginate this kind of query: it will always return one row with two columns (total_comments and total_votes). So, the result described in the blog post as being wrong is actually correct. I'm curious to see if the bug the author describes is present in normal JOIN queries (that is, queries without COUNTs as columns). Without feedback, this bug won't get any attention and it will be closed as Not An Issue.
Posted by Jurrien Stutterheim (norm2782) on 2008-09-19T14:29:12.000+0000
Correction of query in last comment:
<pre class="highlight">
SELECT "deals".*, count(c.id) AS "total_comments", count(v.id) AS "total_votes" FROM "deals"
LEFT JOIN "comments" AS "c" ON deals.id = c.deal_id
LEFT JOIN "votes" AS "v" ON deals.id = v.deal_id GROUP BY "deals"."id"
I'm still not sure if this would actually cause a problem... the adapter the blog post describes is old and there have been quite a lot of updates since then...