Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15724

ClassCastException when specifying the escape character and using like

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 10.8
    • Fix Version/s: 9.11.8, 10.9, 10.8.2
    • Component/s: Query
    • Labels:
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:

      Description

      Using a request with an explicit "escape" clause and a positional argument, such as:

      where ( doc.fullName like ? escape '!' )
      

      led to a ClassCastException because the argument is not transformed.

      Here's a minimal script for reproducing the bug:

      {{velocity}}
      #set ($query = $services.query.hql("where doc.fullName like :docName escape '!'"))
      #set ($docName = "%Bang!!%")
      #set ($query = $query.bindValue('docName').like($docName).query())
      $query.execute()
      {{/velocity}}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                surli Simon Urli
                Reporter:
                surli Simon Urli
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: