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

SQL2 Like operator not working as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 4.0.0.Beta2
    • 4.0.0.Beta1
    • Query
    • None

      Assume I only have the following nodes in the repo that need to be found

      /a/b/c/d/e
      /a/b/c/d[2]/e

      According to XPathToQUeryTranslaterTest (Lines 66 ff) the following queries should deliver the same result:

      /jcr:root/a/b/c/d/e
      returns 2 results

      SELECT * FROM [nt:base] AS BASE WHERE PATH(BASE) LIKE '/a/b/c/d[%]/e[%]'
      returns no result at all

      SELECT * FROM [nt:base] AS BASE WHERE PATH(BASE) LIKE '/a/b/c/d[%]/e%'
      returns only /a/b/c/d[2]/e

      SELECT * FROM [nt:base] AS BASE WHERE PATH(BASE) LIKE '/a/b/c/d%/e%'
      returns 2 results

      So the brackets don't work as expected, but omiting them solves the problem. Is this the expected behaviour or a bug?

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

                Created:
                Updated:
                Resolved: