JSqlParser cannot recognize \' #875
Copy link
Copy link
Closed
Description
Describe the bug
Got JSQLParserException when parsing the following SQLs:
To Reproduce
Cannot parse:
insert into standard_table(gmt_create, gmt_modified, config_name, standard_code) values (now(), now(), null, 'if
@fac.sql_type in
[ 'UPDATE','DELETE','INSERT','INSERT_SELECT']
then
@act.allow_submit
end
');
Will work:
insert into standard_table(gmt_create, gmt_modified, config_name, standard_code) values (now(), now(), null, 'if
@fac.sql_type in
[ "UPDATE","DELETE","INSERT","INSERT_SELECT"]
then
@act.allow_submit
end
');
Expected behavior
A clear and concise description of what you expected to happen.
System
- Database you are using
MySQL - Java Version
Unimportant - JSqlParser version
2.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Cannot parse SQL with "log" as column name, \'UPDATE\' within value[/-][+]Cannot parse SQL with "skip" as column name, \'UPDATE\' within value[/+][-]Cannot parse SQL with "skip" as column name, \'UPDATE\' within value[/-][+]Cannot parse SQL that contains \'UPDATE\' in column value[/+][-]Cannot parse SQL that contains \'UPDATE\' in column value[/-][+]JSqlParser cannot recognize \'[/+]feat: allow `S_CHAR_LITERAL` to break lines
manticore-projects commentedon Jan 16, 2023
Greetings!
You will need to escape the single Quotes
'inside yourCharacter Literaleither SQL:2016 compliant with''or lenient with\'andbackslashEscapingactivated. Please note that the later depends on PR #1715.Example