Bug Report: query rewrite incorrectly moves HAVING clause to WHERE #15836
Labels
Component: Query Serving
Needs Triage
This issue needs to be correctly labelled and triaged
Type: Bug
Overview of the Issue
We have a query that does aggregation in the
SELECT
, which is then referenced inHAVING
. The query planner appears to try to optimize the query by moving it toWHERE
, but since it contains aggregations, the column name hasn't resolved yet, causing a query error.Query that works in MySQL
Query as rewritten by Vitess
Reproduction Steps
Create Table
vschema
Binary Version
Operating System and Environment details
Log Fragments
No response
The text was updated successfully, but these errors were encountered: