[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5539) ParameterParser does not support escaped ' symbols

Alexey Romanchuk (JIRA) noreply at atlassian.com
Tue Sep 7 23:31:18 EDT 2010


ParameterParser does not support escaped ' symbols
--------------------------------------------------

                 Key: HHH-5539
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5539
             Project: Hibernate Core
          Issue Type: Bug
          Components: query-sql
    Affects Versions: 3.6.0.Beta4
         Environment: 3.6.0 and postgresql 8.2.1
            Reporter: Alexey Romanchuk


I create native SQLQuery with createSQLQuery method.
Looks like ParameterParser incorrectly process queries with escaped ' symbol. For example query like "select * from a where a.b = 'asdf \' asdf'" works fine, but "select * from a where a.b = 'asdf \' asdf: '" fails with 

org.hibernate.QueryException: Space is not allowed after parameter prefix ':' 'select * from a where a.b = 'asdf \' asdf''
	at org.hibernate.engine.query.ParameterParser.parse(ParameterParser.java:92)
	at org.hibernate.engine.query.ParamLocationRecognizer.parseLocations(ParamLocationRecognizer.java:75)
	at org.hibernate.engine.query.QueryPlanCache.buildNativeSQLParameterMetadata(QueryPlanCache.java:149)
	at org.hibernate.engine.query.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:79)
	at org.hibernate.impl.AbstractSessionImpl.createSQLQuery(AbstractSessionImpl.java:146)
	at org.hibernate.impl.SessionImpl.createSQLQuery(SessionImpl.java:1656)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list