-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
<S_CHAR_LITERAL> wrongly matches the chars with ' #1172
Comments
I'm confused to the explanation of ~["0"-"9","a"-"z","A"-"Z","'","-"] matches any single character that is not a digit. https://www.engr.mun.ca/~theo/JavaCC-Tutorial/javacc-tutorial.pdf mentioned in Chap 1.4.1 |
This is indeed an open problem of JSqlparser. Since we are supporting multiple databases the escaping of single quotes can be \' or ''. This leads unfortunately to this behavior. Until now I was not able to produce a better regular expression. One solution would be to make this processing either way optional like for instance bracket parsing. Then only one way would be successful and then a correction would be easier.
Additionally, I don't see the connection between your second question to this issue. |
- Enables `\` as escape character in String Literals (beside SQL:2016 compliant `'`) - Default is OFF (since its not SQL:2016 compliant) - Activate per Parser Feature - Fixes JSQLParser#1638 - Fixes JSQLParser#1209 - Fixes JSQLParser#1173 - Fixes JSQLParser#1172 - Fixes JSQLParser#832 - Fixes JSQLParser#827 - Fixes JSQLParser#578 BREAKING-CHANGE: Backslash Escaping needs to be activated explicitly or else Backslash won't work as Escape Character.
* refactor: Merge REPLACE into UPSERT fixes #1706 * feat: `DROP TEMPORARY TABLE ...` fixes #1712 * build: PMD compliance * ci: Merge master * feat: Configurable backslash `\` escaping - Enables `\` as escape character in String Literals (beside SQL:2016 compliant `'`) - Default is OFF (since its not SQL:2016 compliant) - Activate per Parser Feature - Fixes #1638 - Fixes #1209 - Fixes #1173 - Fixes #1172 - Fixes #832 - Fixes #827 - Fixes #578 BREAKING-CHANGE: Backslash Escaping needs to be activated explicitly or else Backslash won't work as Escape Character. * style: Checkstyle * style: remove dead code * style: PMD compliance * style: Checkstyle, unused import * feat: allow `S_CHAR_LITERAL` to break lines - fixes #875
Describe the bug
To Reproduce
Steps to reproduce the behavior:
SELECT A ALIA1, CASE WHEN B LIKE 'ABC\_%' ESCAPE '\' THEN 'DEF' ELSE 'CCCC' END AS OBJ_SUB_TYPE FROM TABLE2
Expected behavior
<S_CHAR_LITERAL> should match the [ '\' ] rather than [ '' THEN ']
System
The text was updated successfully, but these errors were encountered: