mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #7581] Fix LimitSubqueryOutputWalker : Add default order by to sql wrapper if not set. #10554
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?
Original Pull Request: https://github.com/doctrine/orm/pull/7581
State: closed
Merged: No
I got a problem when testing a huge volume of data : greater than offset (of the order of 450000), the query by range returns always the same row (the last one in the list).
Exemple of query :
SELECT distinct id_0 FROM (SELECT o0_.id AS id_0 FROM myTable o0_) dctrn_result LIMIT 1 OFFSET 450001reeturns same row of :
SELECT distinct id_0 FROM (SELECT o0_.id AS id_0 FROM myTable o0_) dctrn_result LIMIT 1 OFFSET 450100Because mysql is not able to assign a default row_num to results, the solution is to define a default
order byin wrap query.Result :
SELECT distinct id_0 FROM (SELECT o0_.id AS id_0 FROM myTable o0_) dctrn_result order by id_0 ASC LIMIT 1 OFFSET 450001Hope it helps..