Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory 
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20105/compiler/algebra/prop

Modified Files:
      Tag: PF_ROX
        prop_key.c 
Log Message:
propagated changes of Monday May 19 2008 - Thursday May 22 2008
from the development trunk to the PF_ROX branch



U prop_key.c
Index: prop_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_key.c,v
retrieving revision 1.37.4.5
retrieving revision 1.37.4.6
diff -u -d -r1.37.4.5 -r1.37.4.6
--- prop_key.c  17 Apr 2008 14:31:19 -0000      1.37.4.5
+++ prop_key.c  22 May 2008 08:48:32 -0000      1.37.4.6
@@ -556,17 +556,35 @@
                                 n->sem.step.guides) <= 1)
                 union_ (n->prop->keys, n->sem.step.iter);
         case la_step:
-            if (n->sem.step.spec.axis == alg_chld &&
+            /* if the input is key the output will be as well
+               (non-recursive downward step) */
+            if ((n->sem.step.spec.axis == alg_chld ||
+                 n->sem.step.spec.axis == alg_attr ||
+                 n->sem.step.spec.axis == alg_self) &&
                 PFprop_key (R(n)->prop, n->sem.step.item))
                 union_ (n->prop->keys, n->sem.step.item_res);
 
+            /* if child step is only a 'filter' (at most a single
+               node for each context node) we can copy all keys */
+            if (n->sem.step.spec.axis == alg_chld &&
+                n->sem.step.spec.kind == node_kind_elem &&
+                ! (PFQNAME_NS_WILDCARD (n->sem.step.spec.qname)
+                   || PFQNAME_LOC_WILDCARD (n->sem.step.spec.qname)) &&
+                PFprop_key (R(n)->prop, n->sem.step.iter))
+                union_ (n->prop->keys, n->sem.step.iter);
+
             /* if attribute step is only a 'filter' (at most a single
                attribute for each context node) we can copy all keys */
             if (n->sem.step.spec.axis == alg_attr &&
                 n->sem.step.spec.kind == node_kind_attr &&
                 ! (PFQNAME_NS_WILDCARD (n->sem.step.spec.qname)
                    || PFQNAME_LOC_WILDCARD (n->sem.step.spec.qname)) &&
-                PFprop_key (R(n)->prop, n->sem.step.item))
+                PFprop_key (R(n)->prop, n->sem.step.iter))
+                union_ (n->prop->keys, n->sem.step.iter);
+
+            /* the self axis can be only a filter */
+            if (n->sem.step.spec.axis == alg_self &&
+                PFprop_key (R(n)->prop, n->sem.step.iter))
                 union_ (n->prop->keys, n->sem.step.iter);
 
             if (PFprop_const (n->prop, n->sem.step.iter))
@@ -604,6 +622,15 @@
                 union_ (n->prop->keys, n->sem.step.item_res);
             }
 
+            /* if child step is only a 'filter' (at most a single
+               node for each context node) we can copy all keys */
+            if (n->sem.step.spec.axis == alg_chld &&
+                n->sem.step.spec.kind == node_kind_elem &&
+                ! (PFQNAME_NS_WILDCARD (n->sem.step.spec.qname)
+                   || PFQNAME_LOC_WILDCARD (n->sem.step.spec.qname)) &&
+                PFprop_key (R(n)->prop, n->sem.step.item))
+                copy (n->prop->keys, R(n)->prop->keys);
+
             /* if attribute step is only a 'filter' (at most a single
                attribute for each context node) we can copy all keys */
             if (n->sem.step.spec.axis == alg_attr &&
@@ -613,6 +640,10 @@
                 PFprop_key (R(n)->prop, n->sem.step.item))
                 copy (n->prop->keys, R(n)->prop->keys);
 
+            /* the self axis can be only a filter */
+            if (n->sem.step.spec.axis == alg_self)
+                copy (n->prop->keys, R(n)->prop->keys);
+
             if (PFprop_card (R(n)->prop) == 1)
                 union_ (n->prop->keys, n->sem.step.item_res);
             break;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to