borinquenkid opened a new issue, #16807:
URL: https://github.com/apache/grails-core/issues/16807

   Split from monolithic audit #16674 (finding F21).
   
   ### Problem Description
   In GORM Data Services, using an aggregate expression inside `@Where`:
   ```groovy
   @Where({ amount > avg(amount) })
   ```
   generates invalid SQL because the aggregate projection (`avg(amount)`) is 
applied directly to the outer `WHERE` clause instead of being encapsulated in a 
subquery (`WHERE amount > (SELECT avg(amount) FROM ...)`).
   
   ### Expected Behavior
   The AST transformation for `@Where` should properly emit a subquery 
expression when an aggregate function is referenced on the right-hand side of a 
comparison operator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to