Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16092/compiler/algebra/opt
Modified Files:
opt_general.brg
Log Message:
propagated changes of Tuesday Feb 17 2009 - Wednesday Feb 18 2009
from the Feb2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/02/17 - tsheyar: compiler/algebra/opt/opt_general.brg,1.63.2.2
-- Bring rewrites into order (such that they do not overlap each other).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U opt_general.brg
Index: opt_general.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_general.brg,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- opt_general.brg 17 Feb 2009 00:53:57 -0000 1.64
+++ opt_general.brg 17 Feb 2009 23:45:47 -0000 1.65
@@ -1357,45 +1357,12 @@
break;
}
} /* fall trough otherwise */
- /* Rel: cast (Rel) */
- case 59:
- {
- /*
- * If an algebra expression already has the requested
- * type, replace it by a projection.
- */
- bool cast_req = true;
- for (unsigned int i = 0; i < p->schema.count; i++)
- if (p->sem.type.col == p->schema.items[i].name &&
- p->sem.type.ty == p->schema.items[i].type) {
- cast_req = false;
- break;
- }
-
- if (!cast_req) {
- PFalg_proj_t *proj = PFmalloc (p->schema.count
- * sizeof (PFalg_proj_t));
-
- for (unsigned int j = 0; j < p->schema.count; j++)
- if (p->schema.items[j].name != p->sem.type.res) {
- proj[j] = PFalg_proj (p->schema.items[j].name,
- p->schema.items[j].name);
- } else {
- proj[j] = PFalg_proj (p->sem.type.res,
- p->sem.type.col);
- }
-
- *p = *PFla_project_ (L(p), p->schema.count, proj);
- SEEN(p) = false;
- relabel (p, kids);
- break;
- }
- } break;
/* Rel: cast (lit_tbl) */
case 58:
/* apply the cast in the literal table */
- if (p->sem.type.ty == aat_int &&
+ if (L(p)->kind == la_lit_tbl &&
+ p->sem.type.ty == aat_int &&
PFprop_type_of (p, p->sem.type.col) == aat_nat) {
unsigned int i, j,
count = p->schema.count,
@@ -1434,7 +1401,42 @@
SEEN(p) = false;
label (p);
}
- break;
+ /* fall trough otherwise */
+
+ /* Rel: cast (Rel) */
+ case 59:
+ {
+ /*
+ * If an algebra expression already has the requested
+ * type, replace it by a projection.
+ */
+ bool cast_req = true;
+ for (unsigned int i = 0; i < p->schema.count; i++)
+ if (p->sem.type.col == p->schema.items[i].name &&
+ p->sem.type.ty == p->schema.items[i].type) {
+ cast_req = false;
+ break;
+ }
+
+ if (!cast_req) {
+ PFalg_proj_t *proj = PFmalloc (p->schema.count
+ * sizeof (PFalg_proj_t));
+
+ for (unsigned int j = 0; j < p->schema.count; j++)
+ if (p->schema.items[j].name != p->sem.type.res) {
+ proj[j] = PFalg_proj (p->schema.items[j].name,
+ p->schema.items[j].name);
+ } else {
+ proj[j] = PFalg_proj (p->sem.type.res,
+ p->sem.type.col);
+ }
+
+ *p = *PFla_project_ (L(p), p->schema.count, proj);
+ SEEN(p) = false;
+ relabel (p, kids);
+ break;
+ }
+ } break;
/* ScjRel: step (Frag, ScjRel) */
case 64:
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins