Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-955135 into 
lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Ghislain Fourny (gislenius)
Related bugs:
  Bug #955135 in Zorba: "err:XQDY0044 not caught by try-catch expressions."
  https://bugs.launchpad.net/zorba/+bug/955135

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

fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-955135/+merge/97470
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-03-12 20:01:39 +0000
+++ ChangeLog	2012-03-14 17:27:29 +0000
@@ -39,6 +39,7 @@
     of the annotations map in expressions.
 
 Bug Fixes/Other Changes:
+  * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
   * Fixed bug 923015 (clone() not implemented for full-text expressions)
   * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
   * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)

=== modified file 'src/runtime/core/constructors.cpp'
--- src/runtime/core/constructors.cpp	2012-02-15 10:25:02 +0000
+++ src/runtime/core/constructors.cpp	2012-03-14 17:27:29 +0000
@@ -545,6 +545,40 @@
   theIsId(false),
   theIsRoot(isRoot)
 {
+  if (theQName)
+  {
+    if (ZSTREQ(theQName->getPrefix(), "xml") &&
+        ZSTREQ(theQName->getLocalName(), "id"))
+      theIsId = true;
+  }
+}
+
+
+void AttributeIterator::serialize(::zorba::serialization::Archiver& ar)
+{
+  serialize_baseclass(ar,
+  (BinaryBaseIterator<AttributeIterator, PlanIteratorState>*)this);
+
+  ar & theQName;
+  ar & theIsId;
+  ar & theIsRoot;
+}
+
+
+bool AttributeIterator::nextImpl(store::Item_t& result, PlanState& planState) const
+{
+  store::Item_t qname;
+  store::Item_t typeName = GENV_TYPESYSTEM.XS_UNTYPED_ATOMIC_QNAME;
+  store::Item_t valueItem;
+  zstring lexicalValue;
+  store::Item_t typedValue;
+  store::Item* parent;
+  bool isId = theIsId;
+  std::stack<store::Item*>& path = planState.theNodeConstuctionPath;
+
+  PlanIteratorState* state;
+  DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
+
   if (theQName != NULL)
   {
     if (theQName->getLocalName().empty())
@@ -583,38 +617,7 @@
         ERROR_LOC( loc )
       );
     }
-
-    if (ZSTREQ(theQName->getPrefix(), "xml") &&
-        ZSTREQ(theQName->getLocalName(), "id"))
-      theIsId = true;
   }
-}
-
-
-void AttributeIterator::serialize(::zorba::serialization::Archiver& ar)
-{
-  serialize_baseclass(ar,
-  (BinaryBaseIterator<AttributeIterator, PlanIteratorState>*)this);
-
-  ar & theQName;
-  ar & theIsId;
-  ar & theIsRoot;
-}
-
-
-bool AttributeIterator::nextImpl(store::Item_t& result, PlanState& planState) const
-{
-  store::Item_t qname;
-  store::Item_t typeName = GENV_TYPESYSTEM.XS_UNTYPED_ATOMIC_QNAME;
-  store::Item_t valueItem;
-  zstring lexicalValue;
-  store::Item_t typedValue;
-  store::Item* parent;
-  bool isId = theIsId;
-  std::stack<store::Item*>& path = planState.theNodeConstuctionPath;
-
-  PlanIteratorState* state;
-  DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
 
   if (theChild0 != NULL)
   {

=== added file 'test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res'
--- test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/trycatch/trycatch12.xml.res	2012-03-14 17:27:29 +0000
@@ -0,0 +1,1 @@
+Invalid attribute.

=== added file 'test/rbkt/Queries/zorba/trycatch/trycatch12.xq'
--- test/rbkt/Queries/zorba/trycatch/trycatch12.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/trycatch/trycatch12.xq	2012-03-14 17:27:29 +0000
@@ -0,0 +1,1 @@
+try { attribute xmlns {} } catch *:XQDY0044 { "Invalid attribute." }

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to