mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3606: [GH-1325] fixed PostgreSQL and Oracle pagination issues #4429
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 9, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of vaheshadunts:
Url: https://github.com/doctrine/doctrine2/pull/1325
Message:
Pagination with ordering on 1:m and m:m relations, was not working
properly because of selecting the ordered fields in main select
statement with distinction (e.g. SELECT DISTINCT e0_.id, p1_.name from
... ) in this case we've received less rows than we've required in
query. So I've modified the subquery generation part.
In case of PostgreSQL and Oracle added the row_number in the subquery
over order by statement, then the main select is grouped by id and
selected min of row number, also ordering by rownumber asc, because they
are on right order already (e.g. select e0_.id, min(rownum) as rownum
from ..... order by rownum).
In case of MySQL, the subselect result with ids are in right order so
there is no need to select that fields(this fixes the same issue too)
In other cases I haven't tested because of that leaved the same.
@doctrinebot commented on GitHub (Mar 9, 2015):
@doctrinebot commented on GitHub (Mar 9, 2015):
Comment created by vaheshadunts:
Hi Benjamin Eberlei, please let me know if I need to change something, I've used regular expression to change the doctrine's generated select statement, if there is a better way please let me know.
The code I've modified
https://github.com/vaheshadunts/doctrine2/blob/DDC-1958/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L221
@doctrinebot commented on GitHub (Mar 9, 2015):
Comment created by vaheshadunts:
Also please let me know should I have to modify the test assertions of the queries which are have changed by my modifications? Or I have to skip the continuous integration ?
@doctrinebot commented on GitHub (Mar 16, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1325] was labeled:
https://github.com/doctrine/doctrine2/pull/1325
@doctrinebot commented on GitHub (Mar 16, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1325] was labeled:
https://github.com/doctrine/doctrine2/pull/1325
@doctrinebot commented on GitHub (Mar 24, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1325] was assigned:
https://github.com/doctrine/doctrine2/pull/1325
@doctrinebot commented on GitHub (Mar 24, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1325] was unlabeled:
https://github.com/doctrine/doctrine2/pull/1325
@doctrinebot commented on GitHub (Mar 24, 2015):
Issue was closed with resolution "Fixed"