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

Query fails unexpectedly when property conversion is not possible

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11
    • jcr, query
    • None

    Description

      A simple xpath query for a string property doesn't work when there is a long (or other inconvertible) property under the same name anywhere in the repository.

      To reproduce:

      • Create a LONG property: /test/@property = 1
      • Run this query: //*[property = "foo"]

      This will throw a NumberFormatException at o.a.j.o.plugins.value.Conversions$Converter.toLong(Conversions.java:80) and fail the query.

      Jackrabbit 2 works well here and simply does not include a match for that node in the result. While I can see that Oak seems to implement the JCR 2.0 spec here:

      If operand1 and operand2 evaluate to values of different property types, the value of operand2 is converted to the property type of the value of operand1 as described in ยง3.6.4 Property Type Conversion. If the type conversion fails, the query is invalid.

      ... I don't think this makes any sense. If conversion does not work, this is simply not a match, but it must not break the query.

      Attachments

        Issue Links

          Activity

            People

              stillalex Alex Deparvu
              alexander.klimetschek Alexander Klimetschek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: