Skip to content

fix: remove \n and \r exclusion from quoted identifiers - #2936

Open
harryfoster2006 wants to merge 3 commits into
JSQLParser:masterfrom
harryfoster2006:fix/newline-parse-fail
Open

harryfoster2006 wants to merge 3 commits into
JSQLParser:masterfrom
harryfoster2006:fix/newline-parse-fail

Conversation

@harryfoster2006

Copy link
Copy Markdown
Contributor

Quoted identifiers that contain a line break failed to parse. For example, a column name copied from a spreadsheet or BI tool, such as "A/\nB", produced a ParseException. The S_QUOTED_IDENTIFIER token explicitly excluded \n and \r from the body of every quoting style.

Fix

Remove the \n / \r exclusion from S_QUOTED_IDENTIFIER in JSqlParserCC.jjt for all four forms:

  • "..." (standard double-quoted)
  • "..." with MySQL backslash escapes ("\" ~[] now accepts a backslash followed by any character, including a newline)
  • ... (backtick)
  • [...] (bracket)

The identifier text is kept verbatim, so the newline survives a parse and deparse round trip unchanged.

This branch has not been deployed

No deployments
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