Update of /cvsroot/monetdb/pathfinder/compiler/sql
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4378
Modified Files:
lalg2sql.brg
Log Message:
Bugfixing in ROWNUM, handling of boolean types, serialization names
Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- lalg2sql.brg 11 Jan 2008 17:15:41 -0000 1.102
+++ lalg2sql.brg 14 Jan 2008 15:32:59 -0000 1.103
@@ -671,6 +671,17 @@
return false;
}
+bool
+column_eq (PFsql_col_t *a, PFsql_col_t *b)
+{
+ if (a->id == PF_SQL_COLUMN_SPECIAL &&
+ b->id == PF_SQL_COLUMN_SPECIAL)
+ return (a->spec == b->spec);
+ else
+ return (a->att == b->att) &&
+ (a->ty == b->ty);
+}
+
/**
* Transforms an expression into a selectlist statement.
*/
@@ -682,12 +693,18 @@
/* we have a different strategy when our item is boolean */
if (col->sem.column.name->ty == aat_bln)
- n = (n->kind == sql_column_name)?
+ n = (n->kind == sql_column_name ||
+ n->kind == sql_lit_int)?
n:
case_ (when (n, lit_int (1)), else_ (lit_int (0)));
if (n->kind == sql_column_name)
- return n;
+ {
+ if (column_eq (n->sem.column.name, col->sem.column.name))
+ return n;
+ else
+ return column_assign (n, col);
+ }
else
return column_assign (n, col);
}
@@ -3542,6 +3559,7 @@
p->sem.sort.part,
type_of (L(p), p->sem.sort.part))));
+ if (srtbylist) orderby = order_by (srtbylist);
col_env_add (COLMAP(p),
p->sem.sort.res,
-------------------------------------------------------------------------
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