chemistry-dev mailing list archives

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


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
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:
>             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

View raw message