-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planner: support union statements with ctes #15312
Conversation
Signed-off-by: Max Englander <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #15312 +/- ##
==========================================
+ Coverage 67.49% 67.55% +0.05%
==========================================
Files 1561 1561
Lines 193355 193389 +34
==========================================
+ Hits 130512 130644 +132
+ Misses 62843 62745 -98 ☔ View full report in Codecov by Sentry. |
@@ -74,6 +74,10 @@ func (node *CommentOnly) Format(buf *TrackedBuffer) { | |||
|
|||
// Format formats the node. | |||
func (node *Union) Format(buf *TrackedBuffer) { | |||
if node.With != nil { | |||
buf.astPrintf(node, "%v", node.With) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxenglander Can you also add a unit test for this to the sqlparser
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go/vt/sqlparser/parse_test.go
is a good place for this
Any chance we can treat this as a bug in the CTE implementation and backport to v19? |
Signed-off-by: Max Englander <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marked this as a bug, since the parser always should roundtrip queries properly but that doesn't happen here.
Signed-off-by: Max Englander <[email protected]>
…15324) Signed-off-by: Max Englander <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Description
Support
WITH ... SELECT ... UNION ... SELECT
CTE syntax.Related Issue(s)
#15311
Checklist
Deployment Notes