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
Bug #22655856: COLUMN NAME IN HAVING, WHICH IS CONTAINED
IN SELECT LIST '*', PRODUCES ERROR
ISSUE:
------
The query EXISTS(SELECT *...) is transformed to
EXISTS(SELECT 1 ...) before all the columns in the inner
subquery have been resolved.
Since mysql allows HAVING without GROUP BY, the columns
in the HAVING clause will need to resolve to the SELECT
list. Replacing * with 1 effectively eliminates this
possibility.
SOLUTION:
---------
The transformation of EXISTS(SELECT *...) to
EXISTS(SELECT 1 ...) will not applied if there is a HAVING
clause in the inner subquery.
0 commit comments