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 B01C398DA for ; Tue, 31 Jul 2012 17:12:36 +0000 (UTC) Received: (qmail 68287 invoked by uid 500); 31 Jul 2012 17:12:35 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 68228 invoked by uid 500); 31 Jul 2012 17:12:35 -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 67974 invoked by uid 99); 31 Jul 2012 17:12:34 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 17:12:34 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id A78F0142856 for ; Tue, 31 Jul 2012 17:12:34 +0000 (UTC) Date: Tue, 31 Jul 2012 17:12:34 +0000 (UTC) From: =?utf-8?Q?C=C3=A9dric_Damioli_=28JIRA=29?= To: dev@jackrabbit.apache.org Message-ID: <1388623782.122181.1343754754688.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Created] (JCR-3401) Wrong results when querying with a DescendantSelfAxisQuery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 C=C3=A9dric Damioli created JCR-3401: ----------------------------------- Summary: Wrong results when querying with a DescendantSelfAxis= Query Key: JCR-3401 URL: https://issues.apache.org/jira/browse/JCR-3401 Project: Jackrabbit Content Repository Issue Type: Bug Components: jackrabbit-core, query Affects Versions: 2.5, 2.4.2 Reporter: C=C3=A9dric Damioli Fix For: 2.4.3, 2.5.1, 2.6 It seems to be caused by the DescendantSelfAxisScorer in the method advance= (int target) : {code} public int advance(int target) throws IOException { if (currentDoc =3D=3D NO_MORE_DOCS) { return currentDoc; } // optimize in the case of an advance to finish. // see https://issues.apache.org/jira/browse/JCR-3082 if (target =3D=3D NO_MORE_DOCS) { subScorer.advance(target); currentDoc =3D NO_MORE_DOCS; return currentDoc; } currentDoc =3D subScorer.nextDoc(); if (currentDoc =3D=3D NO_MORE_DOCS) { return NO_MORE_DOCS; } else { collectContextHits(); return isValid(currentDoc) ? currentDoc : nextDoc(); } } {code} It seems to me that we should have:=20 {code} currentDoc =3D subScorer.advance(target)=20 {code} instead of:=20 {code} currentDoc =3D subScorer.nextDoc(); {code} I could provide a patch but I don't know if this is necessary for a single = line of code. Moreover, I don't know if my fix is ok, as I'm not sure to fully understand= the whole picture. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira