Bugs item #2009467, was opened at 2008-07-03 09:19
Message generated for change (Comment added) made by stmane
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2009467&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.24
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Wouter Alink (vzzzbx)
Assigned to: Stefan Manegold (stmane)
Summary: XQ: nodes change places
Initial Comment:
(MonetDB-0.24, algebra)
see below
-bash-3.2$ cat aap.xml
<aap>
<mies>1</mies>
<mies>2</mies>
</aap>
-bash-3.2$ cat noot.xml
<aap>
<mies>3</mies>
<mies>4</mies>
</aap>
-bash-3.2$ cat beer.xml
<aap>
<mies>5</mies>
<mies>6</mies>
</aap>
-bash-3.2$ cat test_order.xq
for $p in ("/tmp/test_order/aap" ,"/tmp/test_order/beer",
"/tmp/test_order/noot")
let $name := concat($p,".xml")
return pf:add-doc($name, $name)
<>
element result {
for $p in ("/tmp/test_order/aap" ,"/tmp/test_order/beer",
"/tmp/test_order/noot")
return element test {
attribute name {$p},
let $dn := concat($p, ".xml")
return if (exists(pf:documents()[.=$dn]))
then
let $dc := doc($dn)
for $i in $dc//mies
return
element mies {$i/text()}
else ()
}
}
<>
for $p in ("/tmp/test_order/aap" ,"/tmp/test_order/beer",
"/tmp/test_order/noot")
let $name := concat($p,".xml")
return pf:del-doc($name)
results in:
mclient -lxq test_order.xq
<result>
<test name="/tmp/test_order/aap">
<mies>1</mies>
<mies>5</mies>
</test>
<test name="/tmp/test_order/beer">
<mies>3</mies>
<mies>2</mies>
</test>
<test name="/tmp/test_order/noot">
<mies>6</mies>
<mies>4</mies>
</test>
</result>
which is obviously not what was intended...
----------------------------------------------------------------------
>Comment By: Stefan Manegold (stmane)
Date: 2008-10-08 21:04
Message:
Fixed in CVS:
In case the result of loop_lifted_X_step...() is requested to be in
[item,iter] order, we actually need to preserver the fragment-clustering,
i.e., effectively return [cont,item,iter] order
Thanks, for the detailed analysis, Jan!!
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-10-08 19:17
Message:
Seems to work fine with the MPS version; I'll check the ALG version ...
----------------------------------------------------------------------
Comment By: Jan Rittinger (tsheyar)
Date: 2008-09-05 17:42
Message:
Logged In: YES
user_id=993208
Originator: NO
The steps $dc//mies and $i/text() are responsible for the incorrect
behavior. In the stable branch pathfinder plans for both steps to return
their results in item|iter order (note that the HEAD uses a slightly
different plan).
Instead of ordering by cont|pre|iter the 'mies' descendant step returns
its result in the incorrect pre|cont|iter order. The following text step
then gets its input in a different order as it expects and totally screws
up the output order in the end.
Stefan, could you please have a look at the step code -- it is important
that cont is the major ordering and pre the minor.
----------------------------------------------------------------------
Comment By: Wouter Alink (vzzzbx)
Date: 2008-08-08 18:51
Message:
Logged In: YES
user_id=621590
Originator: YES
yes, i think you did too. thanks.
----------------------------------------------------------------------
Comment By: Sjoerd Mullender (sjoerd)
Date: 2008-08-08 15:42
Message:
Logged In: YES
user_id=43607
Originator: NO
Test added as tests/BugTracker test_order.SF-2009467.
Wouter can you check that I did the output correctly (I think I did)?
Assigning to Jan since it looks like an PF-internal issue.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2009467&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