-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
5.5.3-SNAPSHOT
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC and ShardingSphere-Proxy
Expected behavior
WITH RECURSIVE cte AS ( SELECT * from t_user UNION ALL SELECT user_id+1, name FROM cte WHERE user_id < 5 ) SELECT * FROM cte
Above query runs successfully without showing any Error
Actual behavior
Reason analyze (If you can)
if (recursive && segment.getAliasName().isPresent()) {
binderContext.getExternalTableBinderContexts().put(
new CaseInsensitiveString(segment.getAliasName().get()), new SimpleTableSegmentBinderContext(segment.getColumns().stream().map(ColumnProjectionSegment::new).collect(Collectors.toList()), TableSourceType.TEMPORARY_TABLE));
}
In CommonTableExpressionSegmentBinder when getExternalTableBinderContexts is created Shorthand Projections are not caught correctly as Subquery is not binded first but for subquery to be binded we need getExternalTableBinderContexts