Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13821/compiler/algebra
Modified Files:
Tag: PF_ROX
core2alg.brg
Log Message:
propagated changes of Tuesday Jun 17 2008
from the development trunk to the PF_ROX branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/17 - sjoerd: NT/MonetDB4-XQuery/MonetDB4-XQuery-Installer.vdproj,1.14
NT/MonetDB4-XQuery64/MonetDB4-XQuery-Installer.vdproj,1.6
compiler/algebra/core2alg.brg,1.74
propagated changes of Tuesday Jun 17 2008
from the XQuery_0-24 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/17 - tsheyar: compiler/algebra/core2alg.brg,1.71.2.3
-- Fix bug in casting:
Up til now we did not check if the input to a cast contained the correct
number of items.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/17 - sjoerd:
NT/MonetDB4-XQuery/MonetDB4-XQuery-Installer.vdproj,1.12.2.2
Updated version number.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/17 - sjoerd:
NT/MonetDB4-XQuery64/MonetDB4-XQuery-Installer.vdproj,1.4.2.2
Updated version numbers.
Removed JDBC jars.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/17 - sjoerd:
NT/MonetDB4-XQuery/MonetDB4-XQuery-Installer.vdproj,1.12.2.3
Removed JDBC jars.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U core2alg.brg
Index: core2alg.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/core2alg.brg,v
retrieving revision 1.60.4.10
retrieving revision 1.60.4.11
diff -u -d -r1.60.4.10 -r1.60.4.11
--- core2alg.brg 6 Jun 2008 14:25:32 -0000 1.60.4.10
+++ core2alg.brg 17 Jun 2008 13:33:38 -0000 1.60.4.11
@@ -51,6 +51,7 @@
#include "variable.h"
#include "algebra.h"
+#include "builtins.h"
/* Easily access subtree-parts */
#include "child_mnemonic.h"
@@ -1752,6 +1753,7 @@
/* CoreExpr: cast (seqtype, CoreExpr) */
case 21:
{
+ struct PFla_pair_t pair = A(R(p));
PFty_t t;
PFalg_simple_type_t algty;
@@ -1779,12 +1781,23 @@
"don't know the algebra equivalent of type %s",
PFty_str (L(p)->sem.type));
+ /* in case we require a single item and the input
+ may be less or more than a single item add a runtime check */
+ if (PFty_subtype (L(p)->sem.type, PFty_item ()) &&
+ !PFty_subtype (R(p)->type, PFty_item ()))
+ pair = PFbui_fn_exactly_one (LOOP, ORDERING, &pair);
+ /* in case we require zero or one items and the input
+ may be more than a single item add a runtime check */
+ else if (PFty_subtype (L(p)->sem.type, PFty_opt (PFty_item ())) &&
+ !PFty_subtype (R(p)->type, PFty_opt (PFty_item ())))
+ pair = PFbui_fn_zero_or_one (LOOP, ORDERING, &pair);
+
A(p) = (struct PFla_pair_t) {
- .rel = project (cast (A(R(p)).rel, att_cast, att_item, algty),
+ .rel = project (cast (pair.rel, att_cast, att_item, algty),
proj (att_iter, att_iter),
proj (att_pos, att_pos),
proj (att_item, att_cast)),
- .frag = A(R(p)).frag };
+ .frag = pair.frag };
} break;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins