Skip to content
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

Parsing issue in LIKE ESCAPE '\' #578

Closed
anderruiz opened this issue Feb 1, 2018 · 0 comments · Fixed by #1715
Closed

Parsing issue in LIKE ESCAPE '\' #578

anderruiz opened this issue Feb 1, 2018 · 0 comments · Fixed by #1715

Comments

@anderruiz
Copy link

I'm not sure if this is a duplicate of other issues related with ESCAPE keyword, in my case this query is causing an error

SELECT * FROM t1 WHERE UPPER(t1.TIPCOR_A8) like ? ESCAPE '' ORDER BY PERFILB2||TRANSLATE(UPPER(AP1SOL10 || ' ' || AP2SOL10 || ',' || NOMSOL10), '?', 'A') asc

I get this error:

Exception in thread "main" net.sf.jsqlparser.parser.ParseException: Encountered " <S_CHAR_LITERAL> "' || AP2SOL10 || ' "" at line 1, column 112.

Looks like something related with ESCAPE keyword because the parsing works if I changed the ESCAPE from '' to '\' for example

Does it make sense?

manticore-projects added a commit to manticore-projects/JSqlParser that referenced this issue Jan 15, 2023
- 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.
@wumpz wumpz closed this as completed in a00d77a Jan 20, 2023
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 a pull request may close this issue.

1 participant