Skip to content
  • Sreeharsha Ramanavarapu's avatar
    0c0a8912
    Bug #22655856: COLUMN NAME IN HAVING, WHICH IS CONTAINED · 0c0a8912
    Sreeharsha Ramanavarapu authored
                   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.
    0c0a8912
    Bug #22655856: COLUMN NAME IN HAVING, WHICH IS CONTAINED
    Sreeharsha Ramanavarapu authored
                   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.
Loading