Skip to content

Set parsed comments in operator for subqueries (#18369) #177

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

Open
wants to merge 4 commits into
base: release-21.0-github
Choose a base branch
from

Conversation

mhamza15
Copy link

@mhamza15 mhamza15 commented Aug 7, 2025

This is a backport of vitessio#18369

Description

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

@mhamza15 mhamza15 self-assigned this Aug 7, 2025
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 16:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an issue where SQL comments are not properly preserved when subqueries are merged with their outer queries during query planning. The change ensures that comments from the outer query are retained in the merged operator.

  • Adds logic to preserve comments when merging subqueries with outer queries
  • Includes test cases demonstrating comment preservation in both merged and non-merged subquery scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
go/vt/vtgate/planbuilder/operators/subquery_planning.go Adds comment preservation logic in the tryMergeSubqueryWithOuter function
go/vt/vtgate/planbuilder/testdata/select_cases.json Adds test cases verifying comment handling with subqueries

Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
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.

2 participants