Bugs item #2842980, was opened at 2009-08-23 13:21
Message generated for change (Settings changed) made by allexk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2842980&group_id=129076

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Query Execution
Group: Sedna (development)
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Justin Johansson (justinjohansson)
Assigned to: Alexander Kalinin (allexk)
Summary: Executor incorrectly raises XPST0017 for context functions

Initial Comment:
When an XQuery library module defines functions which call fn:last() and 
fn:position() 
Sedna Executor raises ERROR XPST0017 when the module is imported into a XQuery 
main module.

When same library module functions are instead defined in local namespace in 
the main
module, the problem does not occur.

File books.xml:
<books>
  <book name="a"/>
  <book name="b"/>
  <book name="c"/>
</books>


File a.xqlib:
module namespace ns1 = "http://ns1.com";;

declare function ns1:foo( $bks as node()*)
{
  $bks[last()]
};

declare function ns1:bar( $bks as node()*)
{
  $bks[position() = 2]
};


File fault.xq:
LOAD "books.xml" "books"&
LOAD OR REPLACE MODULE "a.xqlib"&


declare function local:foo( $bks as node()*)
{
  $bks[last()]
};

declare function local:bar( $bks as node()*)
{
  $bks[position() = 2]
};

let $bks := doc( "books")/books/book
return ( local:foo( $bks), local:bar( $bks) )&


import module namespace ns1 = "http://ns1.com";;
()&


DROP DOCUMENT "books"&




$ se_gov -version
Sedna Governor Version 3.2.60
Copyright (C) 2004-2009 ISP RAS and others. All rights reserved.
See file COPYRIGHT provided with the distribution.

$ ./fault.sh 
Bulk load succeeded
Bulk load succeeded
<book name="c"/>
<book name="b"/>SEDNA Message: ERROR XPST0017
It is a static error if the expanded QName and number of arguments in a 
function call do not match the name and arity of a function signature in the 
static context.
Details: at (5:8), unknown function 
{http://www.w3.org/2005/xpath-functions}last/1
         at (11:8), unknown function 
{http://www.w3.org/2005/xpath-functions}position/1
         
UPDATE is executed successfully

$


Files attached for your convenience to reproduce the error:

a.xqlib, books.xml, fault.sh, fault.xq


Cheers
Justin Johansson


----------------------------------------------------------------------

>Comment By: Alexander Kalinin (allexk)
Date: 2009-09-07 17:15

Message:
Seems to be fixed in the latest development build.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2842980&group_id=129076

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to