[
https://jira.nuxeo.org/browse/NXP-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Florent Guillaume resolved NXP-4615.
------------------------------------
Resolution: Cannot Reproduce
Not a bug using VCS and NXQL, single quotes in string literals are properly
escaped using backslash single quote.
(Stack trace mistakenly uses JCR, which uses XPath which has different escaping
conventions.)
> NXQL error when field contains '
> --------------------------------
>
> Key: NXP-4615
> URL: https://jira.nuxeo.org/browse/NXP-4615
> Project: Nuxeo Enterprise Platform
> Issue Type: Bug
> Components: Core SQL Storage
> Affects Versions: 5.3 GA
> Environment: Windows Vista running nuxeo Tomcat deployment version 5.3
> Reporter: Tom Akehurst
> Assignee: Florent Guillaume
> Priority: Major
>
> For example: give a nuxeo field string with a ' in it, like Bob's Place.
> There is a method on
> org.nuxeo.ecm.core.query.sql.SQLQueryParser.prepareStringLiteral() which
> seems to be meant to deal with this issue but it has no effect.
> Create a like "select * from Document where myschema:myfield = " +
> org.nuxeo.ecm.core.query.sql.SQLQueryParser.prepareStringLiteral(Bob's Place);
> Using this method I get the following stack trace:
> Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception:
> javax.jcr.query.InvalidQueryException. message: Lexical error at line 1,
> column 82. Encountered: <EOF> after : "\'] return $v" for statement: for $v
> in //element(*,ecmdt:Character)[...@character:firstName = 'Suzy's'] return
> $v: Lexical error at line 1, column 82. Encountered: <EOF> after : "\']
> return $v"
> at
> org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:303)
> at
> org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:332)
> at
> org.apache.jackrabbit.spi.commons.query.xpath.QueryBuilder.createQueryTree(QueryBuilder.java:39)
> at
> org.apache.jackrabbit.spi.commons.query.QueryParser.parse(QueryParser.java:57)
> at
> org.apache.jackrabbit.core.query.lucene.QueryImpl.<init>(QueryImpl.java:92)
> at
> org.apache.jackrabbit.core.query.lucene.SearchIndex.createExecutableQuery(SearchIndex.java:618)
> at org.apache.jackrabbit.core.query.QueryImpl.init(QueryImpl.java:128)
> at
> org.apache.jackrabbit.core.SearchManager.createQuery(SearchManager.java:316)
> at
> org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:102)
> at
> org.nuxeo.ecm.core.repository.jcr.JCRQuery.buildXPathJcrQuery(JCRQuery.java:265)
> ... 33 more
> Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception:
> org.apache.jackrabbit.spi.commons.query.xpath.TokenMgrError. message: Lexical
> error at line 1, column 82. Encountered: <EOF> after : "\'] return $v"
> at
> org.apache.jackrabbit.spi.commons.query.xpath.XPathTokenManager.getNextToken(XPathTokenManager.java:13261)
> at
> org.apache.jackrabbit.spi.commons.query.xpath.XPath.jj_ntk(XPath.java:9193)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets