Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6885/compiler/algebra
Modified Files:
algebra_cse.c builtins.c logical.c physical.c planner.c
Log Message:
* Added the correct mil implementation for the error operator.
Basically it checks at runtime if the BAT with the error message strings is
empty or not. If it is not empty, only one error is produced by fetching
the first row of the BAT.
* Added semantics for the error operator. That actually changed the signature
of the PFla_error and PFpa_error functions so alot of files had to adjust
to these changes. We use the same semantics structure as the cond_err
operator but disregard the sem.err.str part.
Index: physical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/physical.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- physical.c 14 Dec 2007 14:12:13 -0000 1.47
+++ physical.c 19 Dec 2007 22:39:06 -0000 1.48
@@ -3267,7 +3267,7 @@
/**
* Constructor for error
*/
-PFpa_op_t * PFpa_error (const PFpa_op_t *n)
+PFpa_op_t * PFpa_error (const PFpa_op_t *n, PFalg_att_t att)
{
PFpa_op_t *ret = wire1 (pa_error, n);
@@ -3279,8 +3279,15 @@
= PFmalloc (ret->schema.count * sizeof (*(ret->schema.items)));
/* copy schema from n */
- for (unsigned int i = 0; i < n->schema.count; i++)
- ret->schema.items[i] = n->schema.items[i];
+ for (unsigned int i = 0; i < n->schema.count; i++) {
+ ret->schema.items[i] = n->schema.items[i];
+ if (att == n->schema.items[i].name)
+ ret->schema.items[i].type = 0;
+ }
+
+ ret->sem.err.att = att;
+ ret->sem.err.str = "I was there, Case; I was there when "
+ "they invented your kind";
/* ordering stays the same */
for (unsigned int i = 0; i < PFord_set_count (n->orderings); i++)
@@ -3310,7 +3317,7 @@
/* copy schema from n */
for (unsigned int i = 0; i < n->schema.count; i++)
- ret->schema.items[i] = n->schema.items[i];
+ ret->schema.items[i] = n->schema.items[i];
ret->sem.err.att = att;
ret->sem.err.str = err_string;
Index: algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra_cse.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- algebra_cse.c 17 Dec 2007 14:15:20 -0000 1.63
+++ algebra_cse.c 19 Dec 2007 22:39:04 -0000 1.64
@@ -435,7 +435,6 @@
case la_fragment:
case la_frag_union:
case la_empty_frag:
- case la_error:
/* no extra semantic content to check for these operators */
return true;
break;
@@ -461,6 +460,10 @@
return (a->sem.col_ref.pos == b->sem.col_ref.pos);
break;
+ case la_error:
+ return (a->sem.err.att == b->sem.err.att);
+ break;
+
case la_cond_err:
return (a->sem.err.att == b->sem.err.att
&& a->sem.err.str == b->sem.err.str);
Index: planner.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/planner.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- planner.c 19 Dec 2007 16:06:30 -0000 1.44
+++ planner.c 19 Dec 2007 22:39:06 -0000 1.45
@@ -2029,7 +2029,8 @@
PFplanlist_t *ret = new_planlist ();
for (unsigned int i = 0; i < PFarray_last (L(n)->plans); i++)
- add_plan (ret, error(*(plan_t **) PFarray_at (L(n)->plans, i)));
+ add_plan (ret, error(*(plan_t **) PFarray_at (L(n)->plans, i),
+ n->sem.err.att));
return ret;
}
Index: logical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/logical.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- logical.c 17 Dec 2007 14:15:20 -0000 1.72
+++ logical.c 19 Dec 2007 22:39:05 -0000 1.73
@@ -3444,7 +3444,7 @@
*
*/
PFla_op_t *
-PFla_error (const PFla_op_t *n)
+PFla_error (const PFla_op_t *n, PFalg_att_t att)
{
PFla_op_t *ret;
unsigned int i;
@@ -3459,8 +3459,15 @@
= PFmalloc (ret->schema.count * sizeof (*(ret->schema.items)));
/* copy schema from argument 'n' */
- for (i = 0; i < n->schema.count; i++)
+ for (i = 0; i < n->schema.count; i++) {
ret->schema.items[i] = n->schema.items[i];
+ if (att == n->schema.items[i].name)
+ ret->schema.items[i].type = 0;
+ }
+
+ ret->sem.err.att = att;
+ ret->sem.err.str = "Flying is learning how to throw yourself "
+ "at the ground and miss.";
return ret;
}
@@ -4366,7 +4373,7 @@
return PFla_empty_frag ();
case la_error:
- return PFla_error (left);
+ return PFla_error (left, n->sem.err.att);
case la_cond_err:
return PFla_cond_err (left, right,
Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- builtins.c 17 Dec 2007 14:15:20 -0000 1.67
+++ builtins.c 19 Dec 2007 22:39:04 -0000 1.68
@@ -637,10 +637,7 @@
(void) loop; (void) ordering;
return (struct PFla_pair_t) {
- .rel = error( project (args[0].rel,
- proj (att_iter, att_iter),
- proj (att_pos, att_pos),
- proj (att_item, att_item))),
+ .rel = error (args[0].rel, att_item),
.frag = PFla_empty_set ()};
}
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins