Bugs item #1644556, was opened at 2007-01-25 17:03
Message generated for change (Comment added) made by tsheyar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1644556&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 0.16
Status: Open
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Maurice van Keulen (mvankeulen)
Assigned to: Maurice van Keulen (mvankeulen)
Summary: for-at-in combined with recursion counts wrong
Initial Comment:
The "for $var at $pos in $seq return ..." construct gives wrong values for $pos
when recursion is involved. Consider the following query:
declare function test($l1 as node()*, $l2 as node()*)
{
<test>{$l1}<with/>{$l2}<returns>{
for $e1 at $p1 in $l1
,$e2 at $p2 in $l2
where ($e1/name() eq $e2/name())
return (
<found>{$e1}<with/>{$e2}
<cand a="{$p1}" b="{$p2}"/>
</found>
,if ($e1/* or $e2/*)
then <rec>{test($e1/*,$e2/*)}</rec>
else ()
)
}</returns></test>
};
let $l1 := (<a/>,<b/>,<d><y/></d>,<c><x/></c>)
,$l2 := (<b/>,<b/>,<d><x/><y/></d>,<a/>,<c><x/><y/></c>)
return
<a>{
test($l1,$l2)
}</a>
This query tries to find positions of elements with the same name in two
sequences and does this recursively for their children. Below an excerpt of the
output
<test>
<x/>
<with/>
<x/>
<y/>
<returns>
<found>
<x/>
<with/>
<x/>
<cand b="3" a="1"/>
</found>
</returns>
</test>
Note the b="3" there, while we are testing a sequence of one element with a
sequence of two elements. This is clearly wrong, because the position should
never exceed 2 here.
----------------------------------------------------------------------
>Comment By: Jan Rittinger (tsheyar)
Date: 2007-03-12 14:14
Message:
Logged In: YES
user_id=993208
Originator: NO
As Bugfixes should go into the stable branch (and this one did) you have
to ask somebody to propagate this fix (or apply the diff by hand).
----------------------------------------------------------------------
Comment By: Maurice van Keulen (mvankeulen)
Date: 2007-03-12 13:11
Message:
Logged In: YES
user_id=654674
Originator: YES
I just got the new HEAD-version and tried the query, but I still get
erroneous output. I attached an enhanced version of the query. It now
contains an if which compares the positions $p1 and $p2 with the lengths of
the sequences ($l1 and $l2 resp.). If the position goes beyond the end of
the sequence, which should of course never be the case, it puts an
error-element in the result. I still get this error-element in my result if
I execute the query. I also attached the desired output.
----------------------------------------------------------------------
Comment By: Maurice van Keulen (mvankeulen)
Date: 2007-03-12 13:02
Message:
Logged In: YES
user_id=654674
Originator: YES
File Added: bug4.correct.xml
----------------------------------------------------------------------
Comment By: Maurice van Keulen (mvankeulen)
Date: 2007-03-12 13:01
Message:
Logged In: YES
user_id=654674
Originator: YES
File Added: bug4.xq
----------------------------------------------------------------------
Comment By: Jan Rittinger (tsheyar)
Date: 2007-03-11 15:52
Message:
Logged In: YES
user_id=993208
Originator: NO
Ok this one should be fixed. (It took a bit longer than 10 minutes as the
join stuff always needs some time to understand :(.)
Maurice could you please check and add a test to the testweb.
Thanks,
Jan
----------------------------------------------------------------------
Comment By: Peter Boncz (boncz)
Date: 2007-03-11 03:09
Message:
Logged In: YES
user_id=591107
Originator: NO
Hi Jan, I know mps is your nightmare, but.. maybe you could help??
the problem here is the ll_htorered_thetajoin case, that is triggered by
the join being inside a function. For that case, the positional variable on
th inner relation, that is derived by casting "snd_iter" to an integer,
appears to be broken.
I am not sure whether snd_iter is wrong, or (maybe more likely) the
ll_htordered_thetajoin case (in contrsat to htordere_thetajoin), snd_iter
should have been mapped back to something else and that is omitted..
could you maybe give it <10 minutes of your time.. many thanks anticipated
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1644556&group_id=56967
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs