Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3398

LOWER operand with nested LOCALNAME operand does not work with SQL2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.2, 2.4.3
    • 2.6.4, 2.7.1
    • query
    • None
    • Java 6

    Description

      This is the same issue raised here:

      https://issues.apache.org/jira/browse/JCR-3159

      However, it doesn't appear to be fixed. getNodeLocalNameQuery method of LuceneQueryFactory throws an UnsupportedRepositoryOperationException (see stack trace below).

      The reason appears to be that this method is coded to only allow TRANSFORM_NONE. Commenting out this check and the query works as expected.

      Query:

      SELECT * FROM [nt:base] as t where (LOWER(localname(t)) like '%test%' OR contains(t.*, 'test')) AND ISDESCENDANTNODE('/2/8/.documents')

      Stack trace:
      Caused by: javax.jcr.UnsupportedRepositoryOperationException
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getNodeLocalNameQuery(LuceneQueryFactory.java:675)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getComparisonQuery(LuceneQueryFactory.java:627)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:430)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.addBooleanConstraint(LuceneQueryFactory.java:556)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getOrQuery(LuceneQueryFactory.java:532)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:422)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:409)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:359)
      at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.execute(LuceneQueryFactory.java:210)
      at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:465)
      at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:126)
      at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:115)
      at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObjectModelImpl.java:129)
      at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObjectModelImpl.java:124)
      at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
      at org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute(QueryObjectModelImpl.java:123)

      Attachments

        1. LuceneQueryFactory.java.patch
          2 kB
          Federico Grilli

        Activity

          People

            stillalex Alex Deparvu
            balador Andy Savin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: