You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2011/05/31 10:57:47 UTC

[jira] [Updated] (JCR-2939) QueryObjectModel does not generate the corresponding SQL2 Query when dealing with spaces in the path

     [ https://issues.apache.org/jira/browse/JCR-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2939:
-------------------------------

    Issue Type: Bug  (was: Improvement)

> QueryObjectModel does not generate the corresponding SQL2 Query when dealing with spaces in the path
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2939
>                 URL: https://issues.apache.org/jira/browse/JCR-2939
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Alex Parvulescu
>            Assignee: Alex Parvulescu
>            Priority: Minor
>             Fix For: 2.2.7
>
>         Attachments: JCR-2939.patch
>
>
> This is the original issue:
> ----------
> I tried to get the childnodes of a node names "/a b" using the following code
>   QueryManager queryManager=session.getWorkspace().getQueryManager();
>   QueryObjectModelFactory qomf=queryManager.getQOMFactory();
>   Source source1=qomf.selector(NodeType.NT_BASE, "selector_0");
>   Column[] columns = new Column[]{qomf.column("selector_0", null, null)};
>   Constraint constraint2 = qomf.childNode("selector_0", "/a b");
>   QueryObjectModel qom = qomf.createQuery(source1, constraint2 , null, columns);
> This is not giving any result when the session is acquired through webdav. But when connected using JNDI it is giving the child nodes. 
> The sql statement getting created is 
> SELECT selector_0.* FROM [nt:base] AS selector_0 WHERE ISCHILDNODE(selector_0, 
> [/a b]).
> When using webdav If i give this SQL2 query directly along with quotes around 
> the path i.e. ['/a b'] then it is working as expected.
> ----------
> this doesn't have anything to do with webdav. the problem is the QueryObjectModel generates an SQL2 query that is not 100% equivalent, it fails to escape paths that have spaces in them.
> this way, in the case of davex remoting, the jr client will use the statement generated instead, which is not escaped, and will fail to return the expected nodes. 
> This can be seen easily if we do a System.out.println(qom.getStatement())

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira