LimitSubqueryOutputWalker adds items to select from subqueries. #5364

Open
opened 2026-01-22 15:05:30 +01:00 by admin · 0 comments
Owner

Originally created by @roman-slobodzian on GitHub (Dec 24, 2016).

Now such queries

SELECT 
    t1.id, t1.field
FROM
    t1
WHERE
    t1.id IN (SELECT 
            t1_1.id
        FROM
            t1 t1_1
        GROUP BY t1_1.field
        HAVING COUNT(t1_1.field) > 1);

are changed into

SELECT 
    t1.id, t1.field, t1_1.field
FROM
    t1
WHERE
    t1.id IN (SELECT 
            t1_1.id
        FROM
            t1 t1_1
        GROUP BY t1_1.field
        HAVING COUNT(t1_1.field) > 1)

that causes such error Column not found: 1054 Unknown column 't1_1.field' in 'field list'.

Originally created by @roman-slobodzian on GitHub (Dec 24, 2016). Now such queries ```sql SELECT t1.id, t1.field FROM t1 WHERE t1.id IN (SELECT t1_1.id FROM t1 t1_1 GROUP BY t1_1.field HAVING COUNT(t1_1.field) > 1); ``` are changed into ```sql SELECT t1.id, t1.field, t1_1.field FROM t1 WHERE t1.id IN (SELECT t1_1.id FROM t1 t1_1 GROUP BY t1_1.field HAVING COUNT(t1_1.field) > 1) ``` that causes such error `Column not found: 1054 Unknown column 't1_1.field' in 'field list'`.
admin added the BugMissing Tests labels 2026-01-22 15:05:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5364