ZF-3727: Clear limitoffset and limitcount parts in Dbselect adapter when getting the total items count
Description
Counting the total items for the select query returns null when select has limit and offset parts "Row count column not found" exception throwes
Comments
Posted by Jurrien Stutterheim (norm2782) on 2008-07-23T13:36:24.000+0000
If you're trying to provide a custom count query, don't forget to add the zend_paginator_row_count column in the columns part of the query. There's a constant for this in the DbSelect adapter class. Also, the adapter adds the limit and offset parts automatically, so there's no need to do that yourself. I'm closing this as Not an Issue. Please provide some more details if you do think this is a bug :)
Posted by Stanislav Anisimov (satanistlav) on 2008-07-23T14:15:56.000+0000
I think that the offset part is not needed in counting rows. Selecting rows count with offset part will always return null if offset is greater than 0 Ex: select count(*) from bugs LIMIT 10 OFFSET 30
Here are my actual examples:
This code throws the exception
The code works fine after I clear the offset limit part of the select
Posted by Jurrien Stutterheim (norm2782) on 2008-08-04T07:41:10.000+0000
Resolved in revision 10630