Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in
the GROUP BY clause.
Regression in efa1908f662c19038a944129c81462485c4a9fe8.
Backport of 3a941230c85b2702a5e1cd97e17251ce21057efa from master
691def10a0197d83d2d108bd9043b0916d0f09b4 made all Subquery() instances
equal to each other which broke aggregation subquery pushdown which
relied on object equality to determine which alias it should select.
Subquery.__eq__() will be fixed in an another commit but
Query.rewrite_cols() should haved used object identity from the start.
Refs #30727, #30188.
Thanks Makina Corpus for the report.
Backport of adfbf653dc1c1d0e0dacc4ed46602d22ba28b004 from master
Subquery annotation references must be resolved if they are excluded
from the GROUP BY clause by a following .values() call.
Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80.
Thanks Makina Corpus for the report.
Backport of 42c08ee46539ef44f8658ebb1cbefb408e0d03fe from master