From dev-return-32571-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Oct 6 13:24:51 2011 Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1EF47704 for ; Thu, 6 Oct 2011 13:24:51 +0000 (UTC) Received: (qmail 35860 invoked by uid 500); 6 Oct 2011 13:24:51 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 35825 invoked by uid 500); 6 Oct 2011 13:24:51 -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 35818 invoked by uid 99); 6 Oct 2011 13:24:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 13:24:51 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,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; Thu, 06 Oct 2011 13:24:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C93562ACF29 for ; Thu, 6 Oct 2011 13:24:29 +0000 (UTC) Date: Thu, 6 Oct 2011 13:24:29 +0000 (UTC) From: "Lukas Kahwe Smith (Commented) (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <1286158555.3319.1317907469825.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2133656871.11079.1317384046585.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (JCR-3089) javax.jcr.RepositoryException when a JOIN SQL2 query is send via Davex and has results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121933#comment-13121933 ] Lukas Kahwe Smith commented on JCR-3089: ---------------------------------------- yes this happened for a LEFT OUTER JOIN. but thinking about it the problem is more that in my PHP layer we currently just ignore the selectorName, which means that the jcr:path in the result set is probably getting overwritten which is actually what is causing issues on my side. so likely everything is ok here .. > javax.jcr.RepositoryException when a JOIN SQL2 query is send via Davex and has results > -------------------------------------------------------------------------------------- > > Key: JCR-3089 > URL: https://issues.apache.org/jira/browse/JCR-3089 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-server, jackrabbit-spi2dav > Reporter: Lukas Kahwe Smith > Assignee: Alex Parvulescu > Fix For: 2.3.1 > > Attachments: JCR-3089-v2.patch, JCR-3089.patch > > > see the following thread for details: > http://www.mail-archive.com/users@jackrabbit.apache.org/msg17975.html > assuming a data structure as follows: > /foo [nt:unstructured] > /foo/bar [nt:unstructured] > /foo/bar@lala = huii (lala is string property of bar) > /ding [nt:unstructured] > /ding@dong = ##barUUID### (dong is a property of type "Reference") > then the following code will throw an exception: > DavexClient Client = new DavexClient(url); > Repository repo = Client.getRepository(); > Credentials sc = new SimpleCredentials("admin","admin".toCharArray()); > Session s = repo.login(sc,workspace); > QueryManager qm = s.getWorkspace().getQueryManager(); > String sql = "SELECT data.* FROM [nt:unstructured] AS data WHERE data.lala= 'huii'"; > sql = "SELECT * FROM [nt:unstructured] AS data INNER JOIN [nt:unstructured] AS referring ON referring.[dong] = data.[jcr:uuid] WHERE data.lala = 'huii'"; > sql = "SELECT * FROM [nt:unstructured] AS data INNER JOIN [nt:unstructured] AS referring ON ISDESCENDANTNODE(data, referring) WHERE data.lala = 'huii'"; > Query query = qm.createQuery(sql, Query.JCR_SQL2); > QueryResult qr = query.execute(); > The first query works just fine and I can iterate over the result. Neither the second nor the third query works. > In both cases I end up with a javax.jcr.RepositoryException. Note the exception only happens if the query returns results. Aka a join will work just fine if it matches no rows. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira