[Monetdb-developers] [Monetdb-sql-checkins] sql/src/backends/monet5 sql_gencode.mx, , 1.291, 1.292

Stefan Manegold Stefan.Manegold at cwi.nl
Tue Nov 4 08:43:16 CET 2008


What about solving the actual problem and fixing the code properly instead
of just curing/patching symptoms?

In MonetDB type long is not supposed to be used at all as it is not
portable.

What is wrong with using the standard MonetDB type system?

E.g.,

========
$ cvs diff MonetDB5/src/mal/mal_builder.mx sql/src/backends/monet5/sql_gencode.mx
Index: MonetDB5/src/mal/mal_builder.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_builder.mx,v
retrieving revision 1.36
diff -u -r1.36 mal_builder.mx
--- MonetDB5/src/mal/mal_builder.mx	30 Oct 2008 07:28:42 -0000	1.36
+++ MonetDB5/src/mal/mal_builder.mx	4 Nov 2008 07:33:47 -0000
@@ -47,7 +47,7 @@
 mal_export InstrPtr pushChr(MalBlkPtr mb, InstrPtr q, char val);
 mal_export InstrPtr pushOid(MalBlkPtr mb, InstrPtr q, oid val);
 mal_export InstrPtr pushVoid(MalBlkPtr mb, InstrPtr q);
-mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, long val);
+mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, lng val);
 mal_export InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, double val);
 mal_export InstrPtr pushFlt(MalBlkPtr mb, InstrPtr q, float val);
 mal_export InstrPtr pushStr(MalBlkPtr mb, InstrPtr q, const char *val);
@@ -232,7 +232,7 @@
 }
 
 InstrPtr
-pushLng(MalBlkPtr mb, InstrPtr q, long val)
+pushLng(MalBlkPtr mb, InstrPtr q, lng val)
 {
 	int _t;
 	ValRecord cst;
Index: sql/src/backends/monet5/sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.292
diff -u -r1.292 sql_gencode.mx
--- sql/src/backends/monet5/sql_gencode.mx	4 Nov 2008 06:55:24 -0000	1.292
+++ sql/src/backends/monet5/sql_gencode.mx	4 Nov 2008 07:33:47 -0000
@@ -1929,8 +1929,8 @@
         q = newStmt(mb,sqlRef,"keepquery");
 		q= pushInt(mb,q,c->history);
 		q= pushStr(mb,q,t);
-		q= pushLng(mb,q, (long) (GDKusec() - be->mvc->Tparse) );
-		q= pushLng(mb,q, (long) GDKusec());
+		q= pushLng(mb,q, GDKusec() - be->mvc->Tparse);
+		q= pushLng(mb,q, GDKusec());
 		c->Tparse = 0;
 	}
 
========

or even better

========
$ cvs diff MonetDB5/src/mal/mal_builder.mx sql/src/backends/monet5/sql_gencode.mx
Index: MonetDB5/src/mal/mal_builder.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_builder.mx,v
retrieving revision 1.36
diff -u -r1.36 mal_builder.mx
--- MonetDB5/src/mal/mal_builder.mx	30 Oct 2008 07:28:42 -0000	1.36
+++ MonetDB5/src/mal/mal_builder.mx	4 Nov 2008 07:35:53 -0000
@@ -44,14 +44,14 @@
 mal_export InstrPtr pushInt(MalBlkPtr mb, InstrPtr q, int val);
 mal_export InstrPtr pushWrd(MalBlkPtr mb, InstrPtr q, wrd val);
 mal_export InstrPtr pushBte(MalBlkPtr mb, InstrPtr q, bte val);
-mal_export InstrPtr pushChr(MalBlkPtr mb, InstrPtr q, char val);
+mal_export InstrPtr pushChr(MalBlkPtr mb, InstrPtr q, chr val);
 mal_export InstrPtr pushOid(MalBlkPtr mb, InstrPtr q, oid val);
 mal_export InstrPtr pushVoid(MalBlkPtr mb, InstrPtr q);
-mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, long val);
-mal_export InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, double val);
-mal_export InstrPtr pushFlt(MalBlkPtr mb, InstrPtr q, float val);
+mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, lng val);
+mal_export InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, dbl val);
+mal_export InstrPtr pushFlt(MalBlkPtr mb, InstrPtr q, flt val);
 mal_export InstrPtr pushStr(MalBlkPtr mb, InstrPtr q, const char *val);
-mal_export InstrPtr pushBit(MalBlkPtr mb, InstrPtr q, int val);
+mal_export InstrPtr pushBit(MalBlkPtr mb, InstrPtr q, bit val);
 mal_export InstrPtr pushNil(MalBlkPtr mb, InstrPtr q, int tpe);
 mal_export InstrPtr pushNilType(MalBlkPtr mb, InstrPtr q, char *tpe);
 mal_export InstrPtr pushZero(MalBlkPtr mb, InstrPtr q, int tpe);
@@ -193,7 +193,7 @@
 }
 
 InstrPtr
-pushChr(MalBlkPtr mb, InstrPtr q, char val)
+pushChr(MalBlkPtr mb, InstrPtr q, chr val)
 {
 	int _t;
 	ValRecord cst;
@@ -232,7 +232,7 @@
 }
 
 InstrPtr
-pushLng(MalBlkPtr mb, InstrPtr q, long val)
+pushLng(MalBlkPtr mb, InstrPtr q, lng val)
 {
 	int _t;
 	ValRecord cst;
@@ -244,7 +244,7 @@
 }
 
 InstrPtr
-pushDbl(MalBlkPtr mb, InstrPtr q, double val)
+pushDbl(MalBlkPtr mb, InstrPtr q, dbl val)
 {
 	int _t;
 	ValRecord cst;
@@ -256,7 +256,7 @@
 }
 
 InstrPtr
-pushFlt(MalBlkPtr mb, InstrPtr q, float val)
+pushFlt(MalBlkPtr mb, InstrPtr q, flt val)
 {
 	ValRecord cst;
@@ -281,7 +281,7 @@
 }
 
 InstrPtr
-pushBit(MalBlkPtr mb, InstrPtr q, int val)
+pushBit(MalBlkPtr mb, InstrPtr q, bit val)
 {
 	int _t;
 	ValRecord cst;
Index: sql/src/backends/monet5/sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.292
diff -u -r1.292 sql_gencode.mx
--- sql/src/backends/monet5/sql_gencode.mx	4 Nov 2008 06:55:24 -0000	1.292
+++ sql/src/backends/monet5/sql_gencode.mx	4 Nov 2008 07:35:53 -0000
@@ -1929,8 +1929,8 @@
         q = newStmt(mb,sqlRef,"keepquery");
 		q= pushInt(mb,q,c->history);
 		q= pushStr(mb,q,t);
-		q= pushLng(mb,q, (long) (GDKusec() - be->mvc->Tparse) );
-		q= pushLng(mb,q, (long) GDKusec());
+		q= pushLng(mb,q, GDKusec() - be->mvc->Tparse);
+		q= pushLng(mb,q, GDKusec());
 		c->Tparse = 0;
 	}
 
========


Stefan


On Tue, Nov 04, 2008 at 06:55:26AM +0000, Martin Kersten wrote:
> Update of /cvsroot/monetdb/sql/src/backends/monet5
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13501
> 
> Modified Files:
> 	sql_gencode.mx 
> Log Message:
> Silence compiler
> 
> 
> U sql_gencode.mx
> Index: sql_gencode.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
> retrieving revision 1.291
> retrieving revision 1.292
> diff -u -d -r1.291 -r1.292
> --- sql_gencode.mx	3 Nov 2008 15:32:04 -0000	1.291
> +++ sql_gencode.mx	4 Nov 2008 06:55:24 -0000	1.292
> @@ -1929,8 +1929,8 @@
>          q = newStmt(mb,sqlRef,"keepquery");
>  		q= pushInt(mb,q,c->history);
>  		q= pushStr(mb,q,t);
> -		q= pushLng(mb,q,GDKusec() - be->mvc->Tparse);
> -		q= pushLng(mb,q, GDKusec());
> +		q= pushLng(mb,q, (long) (GDKusec() - be->mvc->Tparse) );
> +		q= pushLng(mb,q, (long) GDKusec());
>  		c->Tparse = 0;
>  	}
>  
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Monetdb-sql-checkins mailing list
> Monetdb-sql-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
> 

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list