Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.2-M4
-
Component/s: Persistence
-
Labels:None
-
Patch Submitted:Yes
Description
CriteriaBuilder.list() with pagination and sort parameters cause SQLExceptions in some instances (some database engines).
Example call, assuming Client domain object:
def results = Client.createCriteria().list(max: 10, offset: 10, sort: "firstName", order: "ASC")
The query that is run to get a count includes the 'order by' clause, which causes some database engines to throw an exception.
It's been reported that with hsqldb, the exception occurs when the order by field is not a String (a user had an example with a Date that caused it)
Attachments
Issue Links
| This issue is duplicated by: | ||||
| GRAILS-2475 | Criteria Builder causes SQL errors when using pagination and sort |
|
|
|
I'm not a 100% sure, but I think I had the same problem with Apache Derby and a Date as the type for ordering.