Stefan Kopf created CMIS-640:
--------------------------------

             Summary: Error in SQL grammer: OpenCMIS is enforcing a whitespace 
that is not required in the CMIS spec
                 Key: CMIS-640
                 URL: https://issues.apache.org/jira/browse/CMIS-640
             Project: Chemistry
          Issue Type: Bug
          Components: opencmis-server
    Affects Versions: OpenCMIS 0.8.0
            Reporter: Stefan Kopf


The OpenCMIS sql parser is enforsing at least one  whitespace character between 
the "TIMESTAMP" token and the timestamp string. The input
{code}
    TIMESTAMP '2013-....'
{code}
is accepted while the input
{code}
    TIMESTAMP'2013-...'
{code}
is rejected.
This is not correct. This whitespace char is not required in CMIS 1.0 spec. See 
line 2419 in chapter 2.1.10.2.1 of the cmis 1.0 spec.

This problem is caused by this definition in CmisBaseLexer.g:
{code}
WS : ( ' ' | '\t' | '\r'? '\n' )+ { $channel=HIDDEN; };

TIME_LIT : TIMESTAMP WS STRING_LIT;
{code}
The "+" is "one or more" elements. We should use "*" as "zero or more".
This should work:
{code}
TIME_LIT_WS : ( ' ' | '\t' | '\r'? '\n' )* { $channel=HIDDEN; };

TIME_LIT : TIMESTAMP TIME_LIT_WS STRING_LIT;
{code}
But I think we should also be able to just write:
{code}
TIME_LIT : TIMESTAMP STRING_LIT;
{code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to