[Dbix-class] having attribute with count
Matt S Trout
dbix-class at trout.me.uk
Wed Aug 1 11:01:40 GMT 2007
On Tue, Jul 31, 2007 at 03:01:21PM -0700, Les Fletcher wrote:
> I am building up a result set and am see difference between the actual
> selection of the objects from the database and counting of those same
> objects. The query has a prefetch, groupby, having and a limit clause.
> What I am seeing is that when I request the objects from the database
> the query is working just fine, but when I am doing a count, the having
> clause is dropped from the count query. In the source of resultset I
> see that the having attribute is deleted from time to time and then
> processed differently. Is there something that I can do to ensure that
> the having clause is used in the count? Thanks.
Send us a TODO test and I'll apply it to 09 trunk; count will have to be
rewritten to use a subselect for this to work and SQLA doesn't currently
support them, let alone DBIC, so for the 08 series this is going to have to
stay in "known bug" territory, sorry.
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
More information about the DBIx-Class