Uploaded image for project: 'Chemistry (Retired)'
  1. Chemistry (Retired)
  2. CMIS-640

Error in SQL grammer: OpenCMIS is enforcing a whitespace that is not required in the CMIS spec

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • OpenCMIS 0.8.0
    • None
    • opencmis-server
    • None

    Description

      The OpenCMIS sql parser is enforsing at least one whitespace character between the "TIMESTAMP" token and the timestamp string. The input

          TIMESTAMP '2013-....'
      

      is accepted while the input

          TIMESTAMP'2013-...'
      

      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:

      WS : ( ' ' | '\t' | '\r'? '\n' )+ { $channel=HIDDEN; };
      
      TIME_LIT : TIMESTAMP WS STRING_LIT;
      

      The "+" is "one or more" elements. We should use "*" as "zero or more".
      This should work:

      TIME_LIT_WS : ( ' ' | '\t' | '\r'? '\n' )* { $channel=HIDDEN; };
      
      TIME_LIT : TIMESTAMP TIME_LIT_WS STRING_LIT;
      

      But I think we should also be able to just write:

      TIME_LIT : TIMESTAMP STRING_LIT;
      

      Attachments

        Activity

          People

            jenshuebel Jens Hübel
            stefankopf Stefan Kopf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: