Skip to content

sqlparser: Remove unneeded escaping (#16255) #175

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

Merged
merged 5 commits into from
Aug 8, 2025

Conversation

mhamza15
Copy link

@mhamza15 mhamza15 commented Aug 7, 2025

This is a backport of vitessio#16255

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:31
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 removes unnecessary escaping of double quotes in SQL string literals throughout the Vitess codebase. The change is part of the sqlparser improvements that standardize how string literals are formatted - specifically, since Vitess generates single-quoted strings, double quotes don't need to be escaped.

Key changes:

  • Updated SQL string encoding to avoid escaping double quotes in single-quoted strings
  • Modified test expectations across multiple test files to reflect the new formatting
  • Updated parser test cases to match the new string literal output format

Reviewed Changes

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

Show a summary per file
File Description
go/vt/wrangler/*.go Updated test expectations for vreplication query patterns to use unescaped double quotes
go/vt/vttablet/tabletmanager/vreplication/*.go Updated test patterns for copy state and vreplication queries
go/vt/vtgate/planbuilder/testdata/select_cases.json Updated test expectations for JSON function queries
go/vt/sqlparser/testdata/select_cases.txt Updated parser test cases for string literals
go/vt/sqlparser/parse_test.go Updated parser test expectations and added new test cases
go/vt/sqlparser/ast_format.go Minor formatting fix for index options
go/sqltypes/value.go Core change to SQL encoding logic to avoid escaping double quotes
go/sqltypes/value_test.go Updated encoding test expectations

@arthurschreiber
Copy link
Member

On https://github.com/github/vitess-gh/actions/runs/16810268126?pr=175 you can see 3 failures, which I believe are caused by additional tests that have been added since v19 which still test for the (wrong) double escaping. Should be easy to fix those test cases.

Signed-off-by: Mohamed Hamza <[email protected]>
@mhamza15
Copy link
Author

mhamza15 commented Aug 7, 2025

Flaky test: vitessio#17434

@arthurschreiber arthurschreiber merged commit 4fe826d into release-20.0-github Aug 8, 2025
178 of 185 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.

3 participants