Bugs item #2059394, was opened at 2008-08-19 12:05
Message generated for change (Comment added) made by stmane
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2059394&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/runtime
Group: Pathfinder 0.24
Status: Open
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Wouter Alink (vzzzbx)
>Assigned to: Jan Rittinger (tsheyar)
Summary: XQ: combination of constructed and doc elements
Initial Comment:
Occurs with releases MonetDB-Jun and MonetDB-Aug. Algebra backend.
given a document aap.xml and bug.xq:
-bash-3.1$ cat aap.xml
<?xml version="1.0" encoding="utf-8"?>
<reports>
<folder name="noot">
</folder>
</reports>
-bash-3.1$ cat bug.xq
declare option pf:recursion-depth "5";
declare function doThing($folders as node()*) as node()* {
for $folder in $folders
return element folder { doThing($folder/folder) }
};
doThing((doc("aap.xml")/reports/folder, element folder { }))
-bash-3.1$
-bash-3.1$ mclient -lxq -p51240 bug.xq
MAPI = [EMAIL PROTECTED]:51240
QUERY = declare option pf:recursion-depth "5";
ERROR = !ERROR: PFll_child: cand_bat with kind test must be a real kind bat.
!ERROR: PFll_child: operation failed.
-bash-3.1$
a preliminary investigation seems to point to the following line:
"""
a0009 := step (AXIS_child, TEST_nsloc, a0012, a0010, a0011, nil, ws, 3,
ELEMENT, "", "folder", str(nil));
"""
in which BATs 10 11 and 12 have the following values:
[ "a0010" ]
#-----------------#
# t h # name
# void oid # type
#-----------------#
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
[ "a0011" ]
#-----------------#
# t h # name
# void oid # type
#-----------------#
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
[ "a0012" ]
#-----------------#
# t h # name
# void oid # type
#-----------------#
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
----------------------------------------------------------------------
>Comment By: Stefan Manegold (stmane)
Date: 2008-10-08 19:20
Message:
Fixed in CVS --- this was a "nice" one; took me some time (despite Jan's
detailed preparations; THANKS!) to find out that the solution is quite
simple: we need to reset variable "kind_test" to "chr_nil" in the
loop_lifted_X_step_with_Y_test() PROCs for each fragment ("cont") ...
Also added a test in
pathfinder/tests/BugTracker/Tests/combination_of_constructed_and_doc_elements.SF-2059394.*
Jan, Wouter,
could you please verify the results I check in in
pathfinder/tests/BugTracker/Tests/combination_of_constructed_and_doc_elements.SF-2059394.stable.out
?
Thanks!
Stefan
----------------------------------------------------------------------
Comment By: Jan Rittinger (tsheyar)
Date: 2008-09-05 10:45
Message:
Logged In: YES
user_id=993208
Originator: NO
The query and the generated MIL-code seems correct to me.
Anyway I hunted down that bug a little bit more.
This query seems to be a very rare case where not a special case is hit in
the path algorithms. It can be simplied to e.g.:
((doc("aap.xml")/reports/folder, element folder { }))/folder
The problem resides in lines 181-184 of function PFll_child()
(ll_staircasejoin.mx)
181 if (kind_test != chr_nil) {
182 if (cand_bat->ttype != TYPE_chr ||
/* it contains kinds */
183 BATcount(cand_bat) != BATcount(pre_size) || /* is
the entire pre table */
184 cand_bat->htype != TYPE_void) /* and a real void bat
(i.e. chr array) */
185 {
186 GDKerror("%s: cand_bat with kind test must be a real
kind bat.\n", name);
187 @:ll_return(GDK_FAIL)@
188 }
called from PROC loop_lifted_child_step_with_nsloc_test() where the
problematic input parameters are
print(cands);
#-----------------#
# t h # name
# void oid # type
#-----------------#
[ [EMAIL PROTECTED], [EMAIL PROTECTED] ]
print(pre_size);
#-----------------#
# h t # name
# void int # type
#-----------------#
[ [EMAIL PROTECTED], 6 ]
[ [EMAIL PROTECTED], 5 ]
[ [EMAIL PROTECTED], 4 ]
[ [EMAIL PROTECTED], 0 ]
[ [EMAIL PROTECTED], 1 ]
[ [EMAIL PROTECTED], 0 ]
[ [EMAIL PROTECTED], 0 ]
print(kind_test);
[ '\000' ]
The kind test is true as 'chr(0) != chr(nil)' but the candidate list
contains node references instead of possible kinds.
Stefan could you perhaps have a look?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2059394&group_id=56967
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs