Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 31057 invoked from network); 11 Apr 2011 16:53:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Apr 2011 16:53:46 -0000 Received: (qmail 71953 invoked by uid 500); 11 Apr 2011 16:53:45 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 71915 invoked by uid 500); 11 Apr 2011 16:53:45 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 71908 invoked by uid 99); 11 Apr 2011 16:53:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 16:53:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 16:53:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C27AF9D74A for ; Mon, 11 Apr 2011 16:53:05 +0000 (UTC) Date: Mon, 11 Apr 2011 16:53:05 +0000 (UTC) From: "Alex Parvulescu (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <521492332.49485.1302540785793.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1561380965.49431.1302539946291.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (JCR-2939) QueryObjectModel does not generate the corresponding SQL2 Query when dealing with spaces in the path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Parvulescu updated JCR-2939: --------------------------------- Attachment: JCR-2939.patch attached patch to fix and some tests > 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: Improvement > Reporter: Alex Parvulescu > Priority: Minor > 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