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

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Markos Zaharioudakis (markos-za)
Related bugs:
  Bug #1001463 in Zorba: "type not available during computation of function 
caching"
  https://bugs.launchpad.net/zorba/+bug/1001463

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

fix for bug #1001463 (type not available during computation of function 
caching).

The problem is that the wrong TypeManager is used for checking the 
subtype-relationship during the computation of the function-caching property.

-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1001463/+merge/106686
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-05-18 22:01:56 +0000
+++ ChangeLog	2012-05-21 18:33:24 +0000
@@ -4,6 +4,7 @@
 version 2.x
 
   * Fixed bug #867170 (Variables declared in Prolog are Overwritten inside the query)
+  * Fixed bug #1001463 (type not available during computation of function caching)
 
 
 version 2.5

=== modified file 'src/functions/udf.cpp'
--- src/functions/udf.cpp	2012-05-03 12:31:51 +0000
+++ src/functions/udf.cpp	2012-05-21 18:33:24 +0000
@@ -492,7 +492,7 @@
 
   // parameter and return types are subtype of xs:anyAtomicType?
   const xqtref_t& lRes = theSignature.returnType();
-  TypeManager* tm = lRes->get_manager();
+  TypeManager* tm = theBodyExpr->get_sctx()->get_typemanager();
 
   if (!TypeOps::is_subtype(tm,
                            *lRes,

=== added file 'test/rbkt/ExpQueryResults/zorba/udf/udf-recursive-2.xml.res'
--- test/rbkt/ExpQueryResults/zorba/udf/udf-recursive-2.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/udf/udf-recursive-2.xml.res	2012-05-21 18:33:24 +0000
@@ -0,0 +1,1 @@
+false

=== added file 'test/rbkt/Queries/zorba/udf/schema.xsd'
--- test/rbkt/Queries/zorba/udf/schema.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/udf/schema.xsd	2012-05-21 18:33:24 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema targetNamespace="http://foo.com/schemas/schema";
+  xmlns = "http://foo.com/schemas/schema";
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified">
+
+
+    <xs:element name="Content" type="Content"/>
+
+    <xs:complexType name="Content">
+      <xs:attribute name="id" type="xs:string"></xs:attribute>
+    </xs:complexType>
+
+</xs:schema>

=== added file 'test/rbkt/Queries/zorba/udf/udf-recursive-2.xq'
--- test/rbkt/Queries/zorba/udf/udf-recursive-2.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/udf/udf-recursive-2.xq	2012-05-21 18:33:24 +0000
@@ -0,0 +1,10 @@
+import schema namespace d = "http://foo.com/schemas/schema"; at "schema.xsd";
+
+declare function local:recursion($param as element(*, d:Content)?) as xs:boolean
+{
+  if ($param)
+  then local:recursion(())
+  else false()
+};
+
+local:recursion(validate { <d:Content id="foo"/> })

-- 
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