Skip to content

Fix adjacent string literals in MySQL column defaults - #6727

Open
javamyth wants to merge 1 commit into
alibaba:masterfrom
javamyth:fix/issue-4583-adjacent-string-default
Open

javamyth wants to merge 1 commit into
alibaba:masterfrom
javamyth:fix/issue-4583-adjacent-string-default

Conversation

@javamyth

Copy link
Copy Markdown

Fixes #4583.

Parsing a column default such as DEFAULT '' '0' previously stopped
after the first string literal, leaving the next literal unconsumed
and causing a ParserException.

Reuse primaryLiteralCharsRest in MySqlExprParser to concatenate
adjacent string literals and advance the lexer correctly.

Add regression coverage for single and empty strings, adjacent
and multiple strings, and following comments and column definitions.

Validation:

  • All 9 issue-specific tests passed.
  • MySQL regression tests passed with AntlrMySqlTest excluded.
  • AntlrMySqlTest encountered a resource-directory NullPointerException
    before SQL parsing; this separate issue is not changed in this PR.

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.

MySqlStatementParser解析报错

1 participant