-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
Description
Which version of ShardingSphere did you use?
5.5.2
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
Actual behavior
Cause: org.apache.shardingsphere.infra.exception.kernel.metadata.ColumnNotFoundException: Unknown column 'pp.id' in 'where clause'.
Reason analyze (If you can)
codes in org.apache.shardingsphere.infra.binder.engine.statement.dml.SelectStatementBinder#bind parsed the having columns not using tableBinderContexts, it's supported in 5.4.1 version
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
SELECT
count( 0 )
FROM
(
SELECT
pp.NAME AS partnerName ...
FROM
parking_statistic_spot_order_amount psoa
LEFT JOIN parking_partner_spot pps ON pps.spot_id = psoa.spot_id
LEFT JOIN parking_partner pp ON pps.partner_id = pp.id
WHERE
psoa.statistic_date >= '2025-06-01'
AND psoa.statistic_date <= '2025-06-01'
GROUP BY
statistic_date,
pp.id
HAVING
pp.id IS NOT NULL
) table_count