Bug 139 : Order By clause included in findRowCount query ...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.1.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
14/08/2009
Updated 
14/08/2009
Type 
Bug
 
Attachments 
No attachments

select count(*) from t_oneb t order by t.id
Exception in thread "main" javax.persistence.PersistenceException: org.postgresql.util.PSQLException: ERROR: column "t.id" must appear in the GROUP BY clause or be used in an aggregate function
at com.avaje.ebean.server.query.CQueryEngine.findRowCount(CQueryEngine.java:88)

 
Rob 14 Aug 21:10
ERROR: column "t.id" must appear in the GROUP BY clause

Postgres for one does not like this and you get the error:

org.postgresql.util.PSQLException:
ERROR: column "t.id" must appear in the GROUP BY clause or be used in an aggregate function

Rob 14 Aug 21:26
Fixed in HEAD

The fix is to set the orderBy to null for the find row count.

Fixed in HEAD.

woResponse

Upload a file