chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Hübel (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CMIS-885) regression - query parser accepts invalid queries
Date Tue, 20 Jan 2015 17:57:34 GMT

    [ https://issues.apache.org/jira/browse/CMIS-885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14284113#comment-14284113
] 

Jens Hübel commented on CMIS-885:
---------------------------------

Hi Michael,

Thanks for providing the patch. I agree that this is an issue and merged your patch for the
test.
However the code for your fix caused issues in one of our projects and that's the reason I
have removed these checks.

Imho the proper way to way to check for a proper ending query in AntLR is to have a rule like:
root : query EOF;

Unfortunately QueryUtil did not call the root rule but the query rule and so the EOF was missing.

I changed this in QueryUtilStrict so that now 
        root_return parsedStatement = parser.root();
is called.

I also needed a few changes in the strict grammar to properly catch the parsing errors (AntLR
is really terrible with extension grammars).

Could you verify that this fix also works in your case?

Thanks Jens

> regression - query parser accepts invalid queries
> -------------------------------------------------
>
>                 Key: CMIS-885
>                 URL: https://issues.apache.org/jira/browse/CMIS-885
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 0.12.0
>            Reporter: Michael Brackx
>            Assignee: Jens Hübel
>         Attachments: patch, patch2.txt, patch3.txt
>
>
> regression on CMIS-526
> The fix was in the now deprecated QueryUtil.
> QueryUtilStrict does not have the fix.
> The test QueryParseTest.whereTestTokensAfterStatement() is incorrect and should fail()
inside the try.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message