Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

obfuscate: "query not parsed" for a legitimate looking MySQL query #316

Closed
simonw opened this issue Sep 22, 2017 · 3 comments
Closed

obfuscate: "query not parsed" for a legitimate looking MySQL query #316

simonw opened this issue Sep 22, 2017 · 3 comments

Comments

@simonw
Copy link

simonw commented Sep 22, 2017

We're getting the agent.parse.error of Query not parsed for the following SQL query, which I think the SQL parser should be able to handle:

/* ADB: /sample-path correlation_id:08a3cb269f3211e793b90e80c6e864fc */
select id,field1,field2,field3 from OTable where evnt = %s 
and OTable.status = %s
and ((OTable.survey = "direct" and OTable.payment in ("scramble", "eggs")) 
    or (OTable.email is not null and OTable.email != "")) 
and OTable.status != 350 order by %s

(I added newlines to the above to make it more readable - the query in question does not have newlines in it)

@ufoot
Copy link

ufoot commented Oct 31, 2018

I stumbled on this while searching for another issue, just for the record, the problem here is likely the "" in OTable.email != "". AFAIK the parser considers whatever is enclosed in " is an identifier and not a string value so it's equivalent to (OTable.email is not null and OTable.email != ) which... is not correct.

@gbbr
Copy link
Contributor

gbbr commented Nov 2, 2018

I’ve made some changes recently (present in 6.6.0 and 5.28.0) around the behavior of double quoted strings, perhaps a more recent version would not return an error? I realise this issue is a year old now and I apologise for the lack of responses, but if you are still active and still have this problem, it would help if you could post the original (unmodified) query.

@gbbr gbbr changed the title "query not parsed" for a legitimate looking MySQL query obfuscate: "query not parsed" for a legitimate looking MySQL query Nov 5, 2018
@gbbr gbbr closed this as completed in #514 Nov 5, 2018
@gbbr
Copy link
Contributor

gbbr commented Nov 5, 2018

Should be fixed now. Will be released as part of 6.7.0 late November.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants