You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/12/08 14:05:25 UTC

svn commit: r1643800 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java

Author: thomasm
Date: Mon Dec  8 13:05:25 2014
New Revision: 1643800

URL: http://svn.apache.org/r1643800
Log:
OAK-2320 Wrong optimization for joins with ISDESCENDANTNODE conditions

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java?rev=1643800&r1=1643799&r2=1643800&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java Mon Dec  8 13:05:25 2014
@@ -67,14 +67,8 @@ public class DescendantNodeJoinCondition
     @Override
     public void restrict(FilterImpl f) {
         if (f.getSelector().equals(ancestorSelector)) {
-            String d = descendantSelector.currentPath();
-            if (d == null && f.isPreparing() && f.isPrepared(descendantSelector)) {
-                // during the prepare phase, if the selector is already
-                // prepared, then we would know the value
-                f.restrictPath(KNOWN_PARENT_PATH, Filter.PathRestriction.PARENT);
-            } else if (d != null) {
-                f.restrictPath(PathUtils.getParentPath(d), Filter.PathRestriction.PARENT);
-            }
+            // we ca not currently optimize this case,
+            // as we would need a path restriction of type "ALL_PARENTS".
         }
         if (f.getSelector().equals(descendantSelector)) {
             String a = ancestorSelector.currentPath();