You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Cédric Damioli (JIRA)" <ji...@apache.org> on 2012/07/31 19:12:34 UTC
[jira] [Created] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Cédric Damioli created JCR-3401:
-----------------------------------
Summary: Wrong results when querying with a DescendantSelfAxisQuery
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édric 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 == 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 == NO_MORE_DOCS) {
subScorer.advance(target);
currentDoc = NO_MORE_DOCS;
return currentDoc;
}
currentDoc = subScorer.nextDoc();
if (currentDoc == NO_MORE_DOCS) {
return NO_MORE_DOCS;
} else {
collectContextHits();
return isValid(currentDoc) ? currentDoc : nextDoc();
}
}
{code}
It seems to me that we should have:
{code}
currentDoc = subScorer.advance(target)
{code}
instead of:
{code}
currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Parvulescu updated JCR-3401:
---------------------------------
Resolution: Fixed
Fix Version/s: 2.6
Status: Resolved (was: Patch Available)
thanks Cédric for the contribution!
fixed with revision 1371097.
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Fix For: 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Cédric Damioli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cédric Damioli updated JCR-3401:
--------------------------------
Affects Version/s: 2.3.7
Status: Patch Available (was: Open)
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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, 2.3.7
> Reporter: Cédric Damioli
> Fix For: 2.4.3, 2.5.1, 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Cédric Damioli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427950#comment-13427950 ]
Cédric Damioli commented on JCR-3401:
-------------------------------------
sorry I didn't know
Any chance to see this reviewed and possibly backported in the upcoming 2.4.3 ?
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-3401:
-------------------------------
Fix Version/s: (was: 2.6)
2.5.2
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Assignee: Alex Parvulescu
> Fix For: 2.4.3, 2.5.2
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Bart van der Schans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bart van der Schans closed JCR-3401.
------------------------------------
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Assignee: Alex Parvulescu
> Fix For: 2.4.3, 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Parvulescu updated JCR-3401:
---------------------------------
Fix Version/s: 2.4.3
backported to 2.4 with rev 1372412.
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Assignee: Alex Parvulescu
> Fix For: 2.4.3, 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Cédric Damioli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cédric Damioli updated JCR-3401:
--------------------------------
Attachment: SimpleDescendantSelfAxisTest.java
Attached is a simple test case to reproduce the faulty behaviour in all JR versions since 2.3
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.4.2, 2.5
> Reporter: Cédric Damioli
> Fix For: 2.4.3, 2.5.1, 2.6
>
> Attachments: SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426376#comment-13426376 ]
Alex Parvulescu commented on JCR-3401:
--------------------------------------
Hi Cédric,
> I could provide a patch
Can you provide a unit test showing the error?
This [0] is a good place to start for inspiration.
> Moreover, I don't know if my fix is ok
We have a big suite of tests, get that to pass with your patch and the bulk of the work is done :)
[0] http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.4.2, 2.5
> Reporter: Cédric 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 == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Cédric Damioli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cédric Damioli updated JCR-3401:
--------------------------------
Attachment: DescendantSelfAxisQuery.java.patch
Attached is the proposed fix
Note that it makes the optimization introduced by JCR-3082 useless, so I removed it in the patch
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.4.2, 2.5
> Reporter: Cédric Damioli
> Fix For: 2.4.3, 2.5.1, 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Parvulescu updated JCR-3401:
---------------------------------
Fix Version/s: (was: 2.4.3)
(was: 2.5.1)
(was: 2.6)
removed fix version - we only set it once the code is in
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (JCR-3401) Wrong results when querying with a
DescendantSelfAxisQuery
Posted by "Alex Parvulescu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Parvulescu reassigned JCR-3401:
------------------------------------
Assignee: Alex Parvulescu
> Wrong results when querying with a DescendantSelfAxisQuery
> ----------------------------------------------------------
>
> 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.3.7, 2.4.2, 2.5
> Reporter: Cédric Damioli
> Assignee: Alex Parvulescu
> Fix For: 2.6
>
> Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target) :
> {code}
> public int advance(int target) throws IOException {
> if (currentDoc == 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 == NO_MORE_DOCS) {
> subScorer.advance(target);
> currentDoc = NO_MORE_DOCS;
> return currentDoc;
> }
> currentDoc = subScorer.nextDoc();
> if (currentDoc == NO_MORE_DOCS) {
> return NO_MORE_DOCS;
> } else {
> collectContextHits();
> return isValid(currentDoc) ? currentDoc : nextDoc();
> }
> }
> {code}
> It seems to me that we should have:
> {code}
> currentDoc = subScorer.advance(target)
> {code}
> instead of:
> {code}
> currentDoc = 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira