Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1366

Failure parsing JCR-SQL2 queries that use square brackets to surround paths with SNS indexes

XMLWordPrintable

      In JCR-SQL2, the standard way to quote an identifier (e.g., selector name, literal name, or literal path) is to use square brackets. (See section 6.7.23 in the JCR 2.0 specification.) However, when a path contains a same-name-sibling index, then the path literal also contains square brackets, and our parser gets confused. So this works:

      SELECT * FROM [car:Car] WHERE ISDESCENDANTNODE([car:Car],[/foo/bar])
      

      while this does not work (but should):

      SELECT * FROM [car:Car] WHERE ISDESCENDANTNODE([car:Car],[/foo/bar[2]])
      

      Note the confusing use of square brackets.

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: