Update of /cvsroot/monetdb/pathfinder/tests/BugTracker/Tests
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10606
Modified Files:
Tag: Nov2009
All
Added Files:
Tag: Nov2009
slow_compilation.SF-2898944.bat
slow_compilation.SF-2898944.mod1.xq
slow_compilation.SF-2898944.mod2.xq
slow_compilation.SF-2898944.q1.xq.in
slow_compilation.SF-2898944.q2.xq.in
slow_compilation.SF-2898944.sh
slow_compilation.SF-2898944.stable.err
slow_compilation.SF-2898944.stable.out
slow_compilation.SF-2898944.timeout
Log Message:
added test (compilation via pf, only) for
ID: 2898944 "pf takes 'forever' (> 1 hour) to compile particular query"
https://sourceforge.net/tracker/?func=detail&aid=2898944&group_id=56967&atid=482468
Seems to work fine, now;
compiling both queries with both `pf -A` & `pf -M`
takes less than 2 secs on my machine with a debug build.
Set timeout to 6 secs.
Index: All
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/tests/BugTracker/Tests/All,v
retrieving revision 1.146.2.10
retrieving revision 1.146.2.11
diff -u -d -r1.146.2.10 -r1.146.2.11
--- All 17 Nov 2009 09:59:47 -0000 1.146.2.10
+++ All 18 Nov 2009 17:32:37 -0000 1.146.2.11
@@ -223,3 +223,4 @@
compilation_error.SF-2860574_2
compilation_error.SF-2860037_1
compilation_error.SF-2860037_2
+slow_compilation.SF-2898944
--- NEW FILE: slow_compilation.SF-2898944.mod1.xq ---
module namespace ecv = "http://www.cs.utwente.nl/~belinfan/ecv";
(: this file contains code to apply a given view :)
declare function ecv:print-eprint($entries as element()*) as element()*
{
$entries//fmt/div
};
(: ======================================================================= :)
declare function ecv:generate($doc as xs:string)
as element(tuple)*
{
for $ep in doc($doc)//tuple
where (
( some $c in $ep//assistant_supervisors_family satisfies
contains(upper-case($c), "RENSINK"))
or
( some $c in $ep//supervisors_family satisfies
contains(upper-case($c), "RENSINK"))
)
return $ep
};
declare function ecv:apply-view()
as element()
{
ecv:view-from-save("eprints-export-conv.xml")
};
declare function ecv:view-from-save($doc as xs:string)
as element()
{
let $eplvl0 := ecv:generate($doc)
,$human_type := <m> <e k="mastersthesis">Master's Thesis</e>
<e k="article">Article</e>
<e k="inaugural_lecture">Inaugural lecture</e>
<e k="thesis">PhD Thesis</e>
<e k="conference_item">Conference or Workshop Paper</e>
<e k="book_review">Review</e>
<e k="book_section">Book Section</e>
<e k="intreport">Internal Report</e>
<e k="manual">Manual</e>
<e k="book">Book</e>
<e k="patent">Patent</e>
<e k="extreport">External Report</e>
</m>
,$grpvals0 := for $ep in distinct-values($eplvl0//type/text())
order by $ep descending
return $ep
,$grpvals1 := for $ep in distinct-values($eplvl0//year/text())
order by $ep descending
return $ep
,$head := (
)
,$toc := (: ecv:grouped-toc($eplvl0) :)
let $grpitems0 := for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//type = $g0
return $ep
where not(empty($eplvl1))
return
(
let $grpitems1 := for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//year = $g1
return $ep
where not(empty($eplvl2))
return
(
)
return if (not(empty($grpitems1)))
then $grpitems1
else ()
)
return if (not(empty($grpitems0)))
then $grpitems0
else ()
,$items := (: ecv:grouped-view($eplvl0) :)
for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//type = $g0
return $ep
where not(empty($eplvl1))
return
<div class="type" id="{$g0}"> { (
<h1>{ecv:to-human($g0, $human_type)}</h1>,
for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//year = $g1
return $ep
where not(empty($eplvl2))
return
<div class="year" id="{$g0}::{$g1}"> { (
ecv:print-eprint($eplvl2)
) } </div>
) } </div>
return
<div>{
( if (empty($toc))
then ()
else <div class="toc">{$toc}</div>
,
if (empty($items))
then ()
else <div class="items">{$items}</div>
)
}</div>
};
(:
declare function try($v as xs:string) as xs:string { let $a := <t><n t="a">Aap
jaap</n><n t="b">Beep piep piep</n></t> , $r := for $x in $a//n where $x/@t eq
$v return $x/text() return if (empty($r)) then $v else
string-join($r/string(), "") } ;
<div><p>{try("a")}</p><p>{try("b")}</p><p>{try("c")}</p></div>
:)
declare function ecv:to-human($val as xs:string, $m as element())
as xs:string
{
let $r := for $x in $m//e where $x/@k eq $val
return $x
return
if (empty($r))
then $val
else string-join($r/string(), "")
};
--- NEW FILE: slow_compilation.SF-2898944.q2.xq.in ---
import module namespace ecv = "http://www.cs.utwente.nl/~belinfan/ecv" at
"$TSTSRCDIR/slow_compilation.SF-2898944.mod1.xq";
ecv:view-from-save("eprints-export-conv-fmt.xml")
--- NEW FILE: slow_compilation.SF-2898944.stable.err ---
stderr of test 'slow_compilation.SF-2898944` in directory 'tests/BugTracker`
itself:
# 18:25:46 >
# 18:25:46 > ./slow_compilation.SF-2898944.sh slow_compilation.SF-2898944
# 18:25:46 >
"pf -M slow_compilation.SF-2898944.q1.xq >/dev/null"
"pf -A slow_compilation.SF-2898944.q1.xq >/dev/null"
"pf -M slow_compilation.SF-2898944.q2.xq >/dev/null"
"pf -A slow_compilation.SF-2898944.q2.xq >/dev/null"
# 18:25:48 >
# 18:25:48 > Done.
# 18:25:48 >
--- NEW FILE: slow_compilation.SF-2898944.stable.out ---
stdout of test 'slow_compilation.SF-2898944` in directory 'tests/BugTracker`
itself:
# 18:25:46 >
# 18:25:46 > ./slow_compilation.SF-2898944.sh slow_compilation.SF-2898944
# 18:25:46 >
"pf -M slow_compilation.SF-2898944.q1.xq >/dev/null"
"pf -A slow_compilation.SF-2898944.q1.xq >/dev/null"
"pf -M slow_compilation.SF-2898944.q2.xq >/dev/null"
"pf -A slow_compilation.SF-2898944.q2.xq >/dev/null"
# 18:25:48 >
# 18:25:48 > Done.
# 18:25:48 >
--- NEW FILE: slow_compilation.SF-2898944.q1.xq.in ---
import module namespace ecv = "http://www.cs.utwente.nl/~belinfan/ecv" at
"$TSTSRCDIR/slow_compilation.SF-2898944.mod1.xq";
ecv:view-from-save("eprints-export-conv-fmt.xml")
--- NEW FILE: slow_compilation.SF-2898944.mod2.xq ---
module namespace ecv = "http://www.cs.utwente.nl/~belinfan/ecv";
(: this file contains code to apply a given view :)
declare function ecv:print-eprint($entries as element()*) as element()*
{
$entries//fmt/div
};
(: ======================================================================= :)
declare function ecv:generate($doc as xs:string)
as element(tuple)*
{
for $ep in doc($doc)//tuple
where (
(
(
( some $c in $ep//research_groups satisfies contains(upper-case($c),
"EWI-FMT"))
)
)
)
return $ep
};
declare function ecv:apply-view()
as element()
{
ecv:view-from-save("eprints-export-conv.xml")
};
declare function ecv:view-from-save($doc as xs:string)
as element()
{
let $eplvl0 := ecv:generate($doc)
,$human_type := <m> <e k="mastersthesis">Master's Thesis</e>
<e k="article">Article</e>
<e k="inaugural_lecture">Inaugural lecture</e>
<e k="thesis">PhD Thesis</e>
<e k="conference_item">Conference or Workshop Paper</e>
<e k="book_review">Review</e>
<e k="book_section">Book Section</e>
<e k="intreport">Internal Report</e>
<e k="manual">Manual</e>
<e k="book">Book</e>
<e k="patent">Patent</e>
<e k="extreport">External Report</e>
</m>
,$grpvals0 := for $ep in distinct-values($eplvl0//year/text())
order by $ep ascending
return $ep
,$grpvals1 := for $ep in distinct-values($eplvl0//type/text())
order by $ep ascending
return $ep
,$grpvals2 := for $ep in distinct-values($eplvl0//creators_family/text())
order by $ep ascending
return $ep
,$head := (
<li><h2>year</h2>
<ul>
<li><h2>type</h2>
<ul>
<li><h2>creators_family</h2>
</li>
</ul>
</li>
</ul>
</li>
)
,$toc := (: ecv:grouped-toc($eplvl0) :)
let $grpitems0 := for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//year = $g0
return $ep
where not(empty($eplvl1))
return
(
<li><a href="#{$g0}">{$g0}</a>
{
let $grpitems1 := for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//type = $g1
return $ep
where not(empty($eplvl2))
return
(
<li><a href="#{$g0}::{$g1}">{ecv:to-human($g1,
$human_type)}</a>
{
let $grpitems2 := for $g2 in $grpvals2
let $eplvl3 := for $ep in $eplvl2
where $ep//creators_family =
$g2
return $ep
where not(empty($eplvl3))
return
(
<li><a href="#{$g0}::{$g1}::{$g2}">{$g2}</a>
</li>
)
return if (not(empty($grpitems2)))
then <ul>{$grpitems2}</ul>
else ()
}
</li>
)
return if (not(empty($grpitems1)))
then <ul>{$grpitems1}</ul>
else ()
}
</li>
)
return if (not(empty($grpitems0)))
then <ul>{$grpitems0}</ul>
else ()
,$items := (: ecv:grouped-view($eplvl0) :)
for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//year = $g0
return $ep
where not(empty($eplvl1))
return
<div class="year" id="{$g0}"> { (
<h1>{$g0}</h1>,
for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//type = $g1
return $ep
where not(empty($eplvl2))
return
<div class="type" id="{$g0}::{$g1}"> { (
<h2>{ecv:to-human($g1, $human_type)}</h2>,
for $g2 in $grpvals2
let $eplvl3 := for $ep in $eplvl2
where $ep//creators_family = $g2
return $ep
where not(empty($eplvl3))
return
<div class="creators_family" id="{$g0}::{$g1}::{$g2}"> { (
<h3>{$g2}</h3>,
ecv:print-eprint($eplvl3)
) } </div>
) } </div>
) } </div>
return
<div>{
( if (empty($toc))
then ()
else <div class="toc">{$toc}</div>
,
if (empty($items))
then ()
else <div class="items">{$items}</div>
)
}</div>
};
(:
declare function try($v as xs:string) as xs:string { let $a := <t><n t="a">Aap
jaap</n><n t="b">Beep piep piep</n></t> , $r := for $x in $a//n where $x/@t eq
$v return $x/text() return if (empty($r)) then $v else
string-join($r/string(), "") } ;
<div><p>{try("a")}</p><p>{try("b")}</p><p>{try("c")}</p></div>
:)
declare function ecv:to-human($val as xs:string, $m as element())
as xs:string
{
let $r := for $x in $m//e where $x/@k eq $val
return $x
return
if (empty($r))
then $val
else string-join($r/string(), "")
};
--- NEW FILE: slow_compilation.SF-2898944.sh ---
#!/usr/bin/env bash
q=slow_compilation.SF-2898944.q1.xq
p='pf -M'
echo "\"$p $q >/dev/null\""
echo "\"$p $q >/dev/null\"" >&2
$p $q >/dev/null
p='pf -A'
echo "\"$p $q >/dev/null\""
echo "\"$p $q >/dev/null\"" >&2
$p $q >/dev/null
q=slow_compilation.SF-2898944.q2.xq
p='pf -M'
echo "\"$p $q >/dev/null\""
echo "\"$p $q >/dev/null\"" >&2
$p $q >/dev/null
p='pf -A'
echo "\"$p $q >/dev/null\""
echo "\"$p $q >/dev/null\"" >&2
$p $q >/dev/null
--- NEW FILE: slow_compilation.SF-2898944.timeout ---
0.1
--- NEW FILE: slow_compilation.SF-2898944.bat ---
@echo off
set q=slow_compilation.SF-2898944.q1.xq
set p=pf -M
@echo "%p% %q% >/dev/null"
@echo "%p% %q% >/dev/null" >&2
@%p% %q% > nul
set p=pf -A
@echo "%p% %q% >/dev/null"
@echo "%p% %q% >/dev/null" >&2
@%p% %q% > nul
set q=slow_compilation.SF-2898944.q2.xq
set p=pf -M
@echo "%p% %q% >/dev/null"
@echo "%p% %q% >/dev/null" >&2
@%p% %q% > nul
set p=pf -A
@echo "%p% %q% >/dev/null"
@echo "%p% %q% >/dev/null" >&2
@%p% %q% > nul
------------------------------------------------------------------------------
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-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins