← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug-949910 into lp:zorba

 

Ghislain Fourny has proposed merging lp:~zorba-coders/zorba/bug-949910 into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
  Matthias Brantner (matthias-brantner)
  Sorin Marian Nasoi (sorin.marian.nasoi)
Related bugs:
  Bug #949910 in Zorba: "fn:has-children segfaults on comment nodes"
  https://bugs.launchpad.net/zorba/+bug/949910

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-949910/+merge/96573

Solved bug 949910.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-949910/+merge/96573
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-04-02 08:20:22 +0000
+++ ChangeLog	2012-04-04 16:06:20 +0000
@@ -13,6 +13,7 @@
   * Fixed performance problem with the findNodeSources function of the no-copy rule
   * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
   * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
+  * Fixed bug #949910 (has-children may be invoked on all nodes). Internally, zorba::store::Item::getChildren() now returns NULL on node classes without offspring (instead of raising an error).
 
 
 version 2.2

=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp	2012-03-28 23:58:23 +0000
+++ src/store/naive/node_items.cpp	2012-04-04 16:06:20 +0000
@@ -3759,6 +3759,14 @@
 }
 
 
+/*******************************************************************************
+
+********************************************************************************/
+store::Iterator_t AttributeNode::getChildren() const
+{
+  return NULL;
+}
+
 /////////////////////////////////////////////////////////////////////////////////
 //                                                                             //
 //  class TextNode                                                             //
@@ -4458,6 +4466,14 @@
 #endif // ! TEXT_ORDPATH
 
 
+/*******************************************************************************
+
+********************************************************************************/
+store::Iterator_t TextNode::getChildren() const
+{
+  return NULL;
+}
+
 /////////////////////////////////////////////////////////////////////////////////
 //                                                                             //
 //  class PiNode                                                               //
@@ -4594,6 +4610,14 @@
   return "<?" + theTarget + " " + theContent + "?>";
 }
 
+/*******************************************************************************
+
+********************************************************************************/
+store::Iterator_t PiNode::getChildren() const
+{
+  return NULL;
+}
+
 
 /////////////////////////////////////////////////////////////////////////////////
 //                                                                             //
@@ -4718,6 +4742,15 @@
   return "<!--" + theContent + "-->";
 }
 
+/*******************************************************************************
+
+********************************************************************************/
+store::Iterator_t CommentNode::getChildren() const
+{
+  return NULL;
+}
+
+
 #ifndef ZORBA_NO_FULL_TEXT
 
 /******************************************************************************

=== modified file 'src/store/naive/node_items.h'
--- src/store/naive/node_items.h	2012-03-28 23:58:23 +0000
+++ src/store/naive/node_items.h	2012-04-04 16:06:20 +0000
@@ -1283,6 +1283,8 @@
 #ifndef ZORBA_NO_FULL_TEXT
   void tokenize( XmlNodeTokenizerCallback& );
 #endif
+  
+  store::Iterator_t getChildren() const;
 };
 
 
@@ -1443,6 +1445,8 @@
 #ifndef ZORBA_NO_FULL_TEXT
   void tokenize( XmlNodeTokenizerCallback& );
 #endif /* ZORBA_NO_FULL_TEXT */
+  
+  store::Iterator_t getChildren() const;
 };
 
 
@@ -1508,6 +1512,8 @@
   void replaceName(UpdRenamePi& upd);
 
   void restoreName(UpdRenamePi& upd);
+  
+  store::Iterator_t getChildren() const;
 };
 
 
@@ -1563,6 +1569,8 @@
   void replaceValue(UpdReplaceCommentValue& upd);
 
   void restoreValue(UpdReplaceCommentValue& upd);
+  
+  store::Iterator_t getChildren() const;
 };
 
 

=== added directory 'test/rbkt/ExpQueryResults/zorba/f-and-o'
=== added file 'test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-attribute.xml.res'
--- test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-attribute.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-attribute.xml.res	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+false

=== added file 'test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-comment.xml.res'
--- test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-comment.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-comment.xml.res	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+false

=== added file 'test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-pi.xml.res'
--- test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-pi.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-pi.xml.res	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+false

=== added file 'test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-text.xml.res'
--- test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-text.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/f-and-o/has-children-text.xml.res	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+false

=== added directory 'test/rbkt/Queries/zorba/f-and-o'
=== added file 'test/rbkt/Queries/zorba/f-and-o/has-children-attribute.xq'
--- test/rbkt/Queries/zorba/f-and-o/has-children-attribute.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/f-and-o/has-children-attribute.xq	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+has-children(attribute attribute {""})

=== added file 'test/rbkt/Queries/zorba/f-and-o/has-children-comment.xq'
--- test/rbkt/Queries/zorba/f-and-o/has-children-comment.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/f-and-o/has-children-comment.xq	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+has-children(comment {"comment"})

=== added file 'test/rbkt/Queries/zorba/f-and-o/has-children-pi.xq'
--- test/rbkt/Queries/zorba/f-and-o/has-children-pi.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/f-and-o/has-children-pi.xq	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+has-children(processing-instruction pi {"content"})

=== added file 'test/rbkt/Queries/zorba/f-and-o/has-children-text.xq'
--- test/rbkt/Queries/zorba/f-and-o/has-children-text.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/f-and-o/has-children-text.xq	2012-04-04 16:06:20 +0000
@@ -0,0 +1,1 @@
+has-children(text {"text"})


Follow ups