Skip to content

MySQL: Escape single quotes when displaying IndexOption::Comment - #3046

Open
xgbtxy wants to merge 1 commit into
apache:mainfrom
xgbtxy:fix/index-option-comment-escape
Open

xgbtxy wants to merge 1 commit into
apache:mainfrom
xgbtxy:fix/index-option-comment-escape

Conversation

@xgbtxy

@xgbtxy xgbtxy commented Nov 24, 2026

Copy link
Copy Markdown

CREATE TABLE t (a INT, INDEX idx (a) COMMENT 'foo''bar') currently displays as:

CREATE TABLE t (a INT, INDEX idx (a) COMMENT 'foo'bar')

IndexOption::Comment formatted the raw string unescaped instead of calling escape_single_quote_string like ColumnOption::Comment and TableOption::Comment, breaking round-trip parsing.

This PR formats IndexOption::Comment with escape_single_quote_string and adds MySQL/Generic unit tests plus a fuzz seed.

Verified locally with cargo test --all-features, cargo fmt --all -- --check, and cargo clippy --all-targets --all-features -- -D warnings.

AI assistance was used in discovering this round-trip failure and drafting the fix and tests; all changes were reviewed and verified locally.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 12:50

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the MySQL label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants