You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per discussion in DDC-3336, the Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker does not retain the correct fields in the ORDER BY condition when one of the selected fields is marked as HIDDEN.
As an example, take a DQL query like:
SELECT a, a.name AS HIDDEN ord FROM Doctrine\Tests\ORM\Tools\Pagination\Author a ORDER BY ord DESC
This will result in an SQL query like:
SELECT DISTINCT id*0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn*result
Removing the HIDDEN modifier will cause the query to produce the correct SQL:
SELECT DISTINCT id*0, name_2 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn_result ORDER BY name*2 DESC
The text was updated successfully, but these errors were encountered:
Jira issue originally created by user @Ocramius:
As per discussion in DDC-3336, the
Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker
does not retain the correct fields in theORDER BY
condition when one of the selected fields is marked asHIDDEN
.As an example, take a DQL query like:
SELECT a, a.name AS HIDDEN ord FROM Doctrine\Tests\ORM\Tools\Pagination\Author a ORDER BY ord DESC
This will result in an SQL query like:
SELECT DISTINCT id*0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn*result
Removing the
HIDDEN
modifier will cause the query to produce the correct SQL:SELECT DISTINCT id*0, name_2 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn_result ORDER BY name*2 DESC
The text was updated successfully, but these errors were encountered: