Update of /cvsroot/monetdb/sql/src/common
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27299/src/common

Modified Files:
        sql_types.mx 
Log Message:
count now returns wrd 


U sql_types.mx
Index: sql_types.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/common/sql_types.mx,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- sql_types.mx        2 Sep 2008 13:21:01 -0000       1.111
+++ sql_types.mx        7 Sep 2008 14:27:57 -0000       1.112
@@ -1243,7 +1243,7 @@
        sql_type *ts[100];
        sql_type **strings, **numerical;
        sql_type **decimals, **floats, **dates, **end, **t;
-       sql_type *STR, *BTE, *INT, *LNG, *OID, *BIT, *DBL;
+       sql_type *STR, *BTE, *INT, *LNG, *OID, *BIT, *DBL, *WRD;
        sql_type *SECINT, *MONINT, *DTE; 
        sql_type *TME, *TMETZ, *TMESTAMP, *TMESTAMPTZ;
        sql_type *ANY;
@@ -1264,6 +1264,10 @@
        numerical = t;
 
        OID = *t++ = sql_create_type("OID", 31, 0, 2, EC_NUM, "oid");
+       if (sizeof(wrd) == sizeof(int))
+               WRD = *t++ = sql_create_type("WRD", 32, SCALE_FIX, 2, EC_NUM, 
"wrd");
+       else
+               WRD = *t++ = sql_create_type("WRD", 64, SCALE_FIX, 2, EC_NUM, 
"wrd");
        BTE = *t++ = sql_create_type("TINYINT",   8, SCALE_FIX, 2, EC_NUM, 
"bte");
              *t++ = sql_create_type("SMALLINT", 16, SCALE_FIX, 2, EC_NUM, 
"sht");
        INT = *t++ = sql_create_type("INT",      32, SCALE_FIX, 2, EC_NUM, 
"int");
@@ -1328,7 +1332,9 @@
        sql_create_func3("ifthenelse", "calc", "ifthenelse", BIT, ANY, ANY, 
ANY, SCALE_FIX);
 
        /* sum for numerical and decimals */
-       for (t = numerical+1; t < floats; t += 4) {
+       sql_create_aggr("sum", "aggr", "sum", WRD, WRD);
+       sql_create_aggr("sum", "aggr", "sum", WRD, LNG);
+       for (t = numerical+2 /* skipe OID/WRD */; t < floats; t += 4) {
                sql_create_aggr("sum", "aggr", "sum", *(t), *(t + 1));
                sql_create_aggr("sum", "aggr", "sum", *(t + 1), *(t + 2));
                sql_create_aggr("sum", "aggr", "sum", *(t + 2), *(t + 3));
@@ -1347,8 +1353,8 @@
                sql_create_func("mod", "calc", "fmod", *t, *t, *t, SCALE_FIX);
        }
 
-       sql_create_aggr("count_no_nil", "aggr", "count_no_nil", NULL, INT);
-       sql_create_aggr("count", "aggr", "count", NULL, INT);
+       sql_create_aggr("count_no_nil", "aggr", "count_no_nil", NULL, WRD);
+       sql_create_aggr("count", "aggr", "count", NULL, WRD);
 
        sql_create_func("rank", "calc", "rank_grp", ANY, NULL, INT, SCALE_NONE);
        sql_create_func("dense_rank", "calc", "dense_rank_grp", ANY, NULL, INT, 
SCALE_NONE);


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to