Skip to content

fix: strip trailing semicolon from ALTER statement options#1734

Open
CsongSY wants to merge 1 commit into
github:masterfrom
CsongSY:fix/strip-trailing-semicolon-alter-options
Open

fix: strip trailing semicolon from ALTER statement options#1734
CsongSY wants to merge 1 commit into
github:masterfrom
CsongSY:fix/strip-trailing-semicolon-alter-options

Conversation

@CsongSY

@CsongSY CsongSY commented Jul 2, 2026

Copy link
Copy Markdown

A trailing semicolon in the ALTER statement was carried into alterStatementOptions by the greedy (.*$) capture and never trimmed. When those options are spliced into a larger statement (e.g. appending ", ALGORITHM=INSTANT" in generateInstantDDLQuery) the semicolon lands mid-statement. With multiStatements=true on the applier connection this turns one INSTANT DDL into two statements, silently degrading to a native online DDL and, on error, falling back to the full copy.

Trim the trailing terminator once in ParseAlterStatement so the options stay a clean fragment.

A trailing semicolon in the ALTER statement was carried into
alterStatementOptions by the greedy (.*$) capture and never trimmed.
When those options are spliced into a larger statement (e.g. appending
", ALGORITHM=INSTANT" in generateInstantDDLQuery) the semicolon lands
mid-statement. With multiStatements=true on the applier connection this
turns one INSTANT DDL into two statements, silently degrading to a
native online DDL and, on error, falling back to the full copy.

Trim the trailing terminator once in ParseAlterStatement so the options
stay a clean fragment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant