Bugs item #2716743, was opened at 2009-03-27 12:01
Message generated for change (Settings changed) made by tsheyar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2716743&group_id=56967
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: PF/compiler
Group: Pathfinder "stable"
Status: Open
>Resolution: Postponed
Priority: 2
Private: No
Submitted By: Wouter Alink (vzzzbx)
Assigned to: Jan Rittinger (tsheyar)
Summary: PF: pf:string-value missing
Initial Comment:
The following error occurs for the query below:
$ ~/opt/MonetDB-Feb2009/bin/pf ../bugs/no_string_value_implementation.xq
fatal error: Algebra implementation for function `#pf:string-value' is missing.
What I tried:
- specify the return type of the function: "as node()*" (which does not work)
- specify the return type of the function: "as element()*" (which works fine)
- inline the function in the query "let $items := $patents//country" (works
fine too)
----------------------------------
declare function do($nodes as node()*) {
$nodes//country
};
let $countries := ("NL","DE","UK")
let $patents := (<entry><country>NL</country></entry>,
<entry><country>DE</country></entry>)
let $items := do($patents)
for $i at $k in $items
let $country := $countries[. = $i]
return element { "entry" } { $i, $country }
----------------------------------------------------------------------
Comment By: Wouter Alink (vzzzbx)
Date: 2009-06-25 16:34
Message:
I found another/better example for this bug (I think it is the same bug,
correct me if i'm wrong). This fails:
declare function equalA($a, $b) as xs:boolean {
$a=$b
};
equalA("a","b")
It produces:
$ mclient -lxq -p50100 < ~/tmp/xqBug.xq
MAPI = mone...@localhost:50100
QUERY = declare function equalA($a, $b) as xs:boolean {
ERROR = !fatal error: Algebra implementation for function
`#pf:string-value' is missing.
!# halted in
/home/alink/workspace/MonetDB/pathfinder/compiler/algebra/builtins.c
(PFbui_pf_string_value), line 6341
This xquery fails, while the following works fine:
declare function equalA($a as xs:string, $b as xs:string) as xs:boolean {
$a=$b
};
equalA("a","b")
so again, "stricter types" for UDFs is the solution? (note that this time
it affects the input parameters of the function)
----------------------------------------------------------------------
Comment By: Jan Rittinger (tsheyar)
Date: 2009-04-07 14:07
Message:
Currently we only resolve string-value if (at compile time) we can derive a
type for which we have a translation on the MIL level. As there is no code
that can provide the string-value of mixed node sequences an error is
generated.
A solution which (almost) always helps is a stricter return type for UDFs.
----------------------------------------------------------------------
Comment By: Peter Boncz (boncz)
Date: 2009-04-07 13:38
Message:
it is interesting that there is a difference between node() and element()
Jan, any idea?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2716743&group_id=56967
------------------------------------------------------------------------------
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
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs