openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <>
Subject [jira] Created: (OPENJPA-1295) Query with Escape '\' fails in MySQL
Date Fri, 11 Sep 2009 23:11:57 GMT
Query with Escape '\' fails in MySQL

                 Key: OPENJPA-1295
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 2.0.0
            Reporter: Fay Wang
             Fix For: 2.0.0

The following jpql fails in MySQL: 

Select e from Employee e where LIKE :name ESCAPE '\'

The exception trace:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near ''\')' at line 1 {prepstmnt 1239002810 SELECT t0.empId,
t0.hireDate, t0.hireTime, t0.hireTimestamp,, t0.someLong, t0.statusId FROM SUBQ_EMPLOYEE
t0 WHERE ( LIKE ? ESCAPE '\') [params=(String) M\%%]} [code=1064, state=42000]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(
at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(

The test case is org.apache.openjpa.persistence.query.TestQueryEscapeCharacters.testEscapedQuery

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message