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

JSQL can't escape Single Quote #167

Closed
amolskh opened this issue Sep 2, 2015 · 4 comments
Closed

JSQL can't escape Single Quote #167

amolskh opened this issue Sep 2, 2015 · 4 comments

Comments

@amolskh
Copy link

amolskh commented Sep 2, 2015

I am having query

UPDATE tablename SET NAME='Customer 2',ADDRESS='Address ' ddad2',AUTH_KEY='samplekey' WHERE ID=2;

I am fine if we need to do

UPDATE tablename SET NAME='Customer 2',ADDRESS='Address ' ddad2',AUTH_KEY='samplekey' WHERE ID=2;

This query worked fine on mysql workbench or other SQL agents.. But when I try to parse the Query in JSQL it dosent manage to parse.. Is there any other alternative??

Can you tell me meaning of these 2 regex
For both defects i think i need to play around with these regex

| < S_CHAR_LITERAL: "'" (["'"])* "'" ("'" (["'"])* "'")>
| < S_QUOTED_IDENTIFIER: """ (~["\n","\r","""])+ """ | ("" (~["\n","\r",""])+ "`") | ( "" ~["0"-"9","]"
"]" ) >

@amolskh
Copy link
Author

amolskh commented Sep 3, 2015

I think using query in this format fixes it
UPDATE tablename SET NAME='Customer 2',ADDRESS='Address '' ddad2',AUTH_KEY='samplekey' WHERE ID=2;

@wumpz
Copy link
Member

wumpz commented Sep 3, 2015

Right. JSqlParser only supports usage of double quotation ('') and not backslash escaping.

@wumpz
Copy link
Member

wumpz commented Sep 3, 2015

So could we close this one, as you provided a solution?

@amolskh
Copy link
Author

amolskh commented Sep 3, 2015

ok sure

@wumpz wumpz closed this as completed Sep 3, 2015
wumpz added a commit that referenced this issue Sep 16, 2015
wumpz added a commit that referenced this issue Sep 16, 2015
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

No branches or pull requests

2 participants