Skip to content

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 AI review requested due to automatic review settings August 7, 2025 16:54
Copy link

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

@mhamza15 mhamza15 merged commit b15fabe into release-21.0-github Sep 3, 2025
161 of 193 checks passed
@mhamza15 mhamza15 deleted the mhamza/backport-18369-v21 branch September 3, 2025 22:38
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.

3 participants