← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba

 

Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/92942

Fixed bug #872288
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/92942
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-02-14 10:06:26 +0000
+++ ChangeLog	2012-02-14 10:30:19 +0000
@@ -18,6 +18,7 @@
   * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
     case of early-out)
   * Added index management function to the C++ api's StaticCollectionManager.
+  * Fixed bug #872288 (reset recursive flag during node rename)
   * Fixed bug #905041 (allow for the default element and function namespaces to be
     set multiple times via the c++ api).
   * Fixed bug #907872 (segfault when returning an input ItemSequence from an external function).

=== modified file 'src/store/naive/node_updates.cpp'
--- src/store/naive/node_updates.cpp	2012-02-02 14:42:18 +0000
+++ src/store/naive/node_updates.cpp	2012-02-14 10:30:19 +0000
@@ -229,12 +229,12 @@
       // Attach the attributes of this node to the new tree.
       AttributeNode* baseUriAttr = NULL;
       AttributeNode* hiddenBaseUriAttr = NULL;
-      ulong numAttrs = elem->numAttrs();
+      csize numAttrs = elem->numAttrs();
 
       InternalNode::iterator ite = elem->attrsBegin();
       InternalNode::iterator end = elem->attrsEnd();
 
-      for (ulong i = 0; ite != end; ++i, ++ite)
+      for (csize i = 0; ite != end; ++i, ++ite)
       {
         AttributeNode* attr = static_cast<AttributeNode*>(*ite);
 
@@ -1361,6 +1361,24 @@
   {
     removeType(upd);
   }
+
+  if (theParent)
+  {
+    XmlNode* ancestor = theParent;
+
+    while (ancestor != NULL &&
+           ancestor->getNodeKind() == store::StoreConsts::elementNode)
+    {
+      ElementNode* elemAncestor = reinterpret_cast<ElementNode*>(ancestor);
+      if (elemAncestor->theName->equals(theName))
+      {
+        elemAncestor->setRecursive();
+        break;
+      }
+      
+      ancestor = ancestor->theParent;
+    }
+  }
 }
 
 

=== added file 'test/rbkt/ExpQueryResults/zorba/updates/recursive.xml.res'
--- test/rbkt/ExpQueryResults/zorba/updates/recursive.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/updates/recursive.xml.res	2012-02-14 10:30:19 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<first><a><a/></a><a/></first>

=== added file 'test/rbkt/Queries/zorba/updates/recursive.xq'
--- test/rbkt/Queries/zorba/updates/recursive.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/updates/recursive.xq	2012-02-14 10:30:19 +0000
@@ -0,0 +1,11 @@
+variable $x:=<y><a/></y>;
+
+insert node <b/> into $x/a;
+
+rename node $x/a/b as "a";
+
+<first>
+{
+$x//a
+}
+</first>


Follow ups