Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-5413

XPath: "union" combined with "or" is not converted correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.18, 1.6.0
    • Component/s: query
    • Labels:
      None

      Description

      In OAK-4265 a limited form of "union" for XPath was added. However, union queries that contain "or" are not converted properly. For example:

      //*[@a=1 or @b=1]
      select [jcr:path], [jcr:score], * from [nt:base] as a where [a] = 1 
      union select [jcr:path], [jcr:score], * from [nt:base] as a where [b] = 1
      

      but

      (//*[@a=1 or @b=1] | //*[@c=1])
      select [jcr:path], [jcr:score], * from [nt:base] as a where [a] = 1 or [b] = 1 
      union select [jcr:path], [jcr:score], * from [nt:base] as a where [c] = 1
      

      It should be converted to:

      select [jcr:path], [jcr:score], * from [nt:base] as a where [a] = 1 
      union select [jcr:path], [jcr:score], * from [nt:base] as a where [b] = 1 
      union select [jcr:path], [jcr:score], * from [nt:base] as a where [c] = 1 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thomasm Thomas Mueller
                Reporter:
                thomasm Thomas Mueller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: