Skip to content

18369 backport to v22 branch#227

Merged
andyedison merged 2 commits into
release-22.0-githubfrom
backport-18369-v22
Jun 4, 2026
Merged

18369 backport to v22 branch#227
andyedison merged 2 commits into
release-22.0-githubfrom
backport-18369-v22

Conversation

@andyedison

Copy link
Copy Markdown

Description

this is a backport of vitessio#18369

we still need this as it was discovered v22 upstream still doesn't have this applied when we found comments were removed in our testing of plans https://github.com/github/vitess/issues/1560#issuecomment-4613797538

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

* Set parsed comments in operator for subqueries (vitessio#18369)

Signed-off-by: David Piegza <davidpiegza@github.com>

* rerun ci

Signed-off-by: Mohamed Hamza <mhamza15@github.com>

* remove skip_e2e

Signed-off-by: Mohamed Hamza <mhamza15@github.com>

* fix test cases

---------

Signed-off-by: David Piegza <davidpiegza@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Co-authored-by: David Piegza <697113+davidpiegza@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 14:53
@andyedison andyedison changed the title 18369 18369 backport to v22 branch Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backport of upstream Vitess PR vitessio#18369 to ensure planner preserves SQL comments when subqueries are merged into a single Route, backed by new plan testcases.

Changes:

  • Add plan test coverage for comment preservation with mergeable and non-mergeable subqueries.
  • Preserve Route.Comments when merging a subquery into an outer route.
Show a summary per file
File Description
go/vt/vtgate/planbuilder/testdata/select_cases.json Adds testcases asserting comments remain present in planned queries involving subqueries.
go/vt/vtgate/planbuilder/operators/subquery_planning.go Copies outer route comments onto the merged route during subquery merge.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +554 to +556
if outer.Comments != nil {
op.Comments = outer.Comments
}
The backport of upstream PR vitessio#18369 dropped the Type field from both
new test cases in select_cases.json. The v22 planner still emits this
field, so the tests were failing with a diff on Type: Scatter and
Type: Complex respectively.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Andy Edison <andyedison@github.com>
@andyedison
andyedison merged commit 3a64a91 into release-22.0-github Jun 4, 2026
101 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants