Bug 287054 - setMaxRows on a subselect is not performed
Summary: setMaxRows on a subselect is not performed
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-19 09:10 EDT by Florian Wunderlich CLA
Modified: 2022-06-09 10:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Wunderlich CLA 2009-08-19 09:10:43 EDT
If a ReportQuery is constructed on which setMaxRows is invoked, and if this ReportQuery is used as a subquery in a ReadAllQuery using Expression.in(), then the LIMIT clause is missing on PostgreSQL.

If setMaxRows is invoked on the surrounding ReadAllQuery, the LIMIT clause is present, but this is obviously not a functioning workaround.
Comment 1 Tom Ware CLA 2009-08-31 09:29:31 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Chris Delahunt CLA 2011-10-26 11:49:47 EDT
SetMaxRows is not intended to be used for subqueries, and is only intended to be used to limit the results for the outer most query.  

This is because the original implementation used JDBC to limit results; using LIMIT is only one implementation.  While LIMIT makes it possible to do for PostgreSQL in a subquery, it would give different results on other platforms.

Changing this to a feature as it is not a bug.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:30:10 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink