Update of /cvsroot/monetdb/sql/src/backends/monet4
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1792/src/backends/monet4

Modified Files:
        sql_result.mx sql_user.mx 
Log Message:
Type cleanup.

Counting and indexing BUNs in a BAT is now done exclusively using the
type BUN.  This means that e.g. the BATcount function now returns a
BUN instead of a size_t (with many more similar changes).  It also
means that all uses of the hash_t type have been replaced by BUN.

vheaps are now exclusively indexed using the type var_t.

A few new constants have been introduced:
VAR_MAX - maximum allowed value of a value of type var_t.
BUN_MAX - maximum allowed value of a value of type BUN.
OIDFMT (existed already) - format string to print a value of type oid.
BUNFMT - format string to print a value of type BUN.
VARFMT - format string to print a value of type var_t.


U sql_result.mx
Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_result.mx,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- sql_result.mx       21 Mar 2008 09:39:31 -0000      1.83
+++ sql_result.mx       25 Aug 2008 13:36:15 -0000      1.84
@@ -32,7 +32,7 @@
 extern int mvc_export_value( mvc *m, stream *s, int qtype, str tn, str cn, str 
type, int d, int sc, int eclass, ptr p, int mtype, str w, str ns);
 extern int mvc_export_result(mvc *c, stream *s, int res_id, str w);
 extern int mvc_export_prepare(mvc *c, stream *s, cq *q, str w);
-extern int mvc_export_chunk(mvc *m, stream *s, int res_id, size_t offset, 
size_t nr);
+extern int mvc_export_chunk(mvc *m, stream *s, int res_id, BUN offset, BUN nr);
 
 extern BAT *mvc_import_table(mvc *c, bstream *s, char *sname, char *tname, 
char *sep, char *rsep, char *ssep, char *ns, int nr, int offset);
 extern int mvc_result_table(mvc *m, int nr_cols, int type, BAT *order);
@@ -474,7 +474,7 @@
                        }
                }
                if (ASCIIcreate_bats(&as) >= 0) {
-                       if (ASCIIload_file(&as, bs, out) >= 0)
+                       if (ASCIIload_file(&as, bs, out) != BUN_NONE)
                                bats = ASCIIcollect_bats(&as);
                }
                GDKfree(dec);
@@ -661,8 +661,8 @@
 static int
 mvc_export_row(mvc *m, stream *s, res_table *t, str btag, str sep, str rsep, 
str ssep, str ns)
 {
-       int seplen = strlen(sep);
-       int rseplen= strlen(rsep);
+       size_t seplen = strlen(sep);
+       size_t rseplen= strlen(rsep);
        char *buf = NULL;
        int len = 0;
        int i, ok = 1;
@@ -694,11 +694,11 @@
 }
 
 static int
-mvc_export_table(mvc *m, stream *s, res_table *t, BAT *order, size_t offset, 
size_t nr, char *btag, char *sep, char *rsep, char *ssep, char *ns )
+mvc_export_table(mvc *m, stream *s, res_table *t, BAT *order, BUN offset, BUN 
nr, char *btag, char *sep, char *rsep, char *ssep, char *ns )
 {
        ascii as;
        ascii_io *fmt;
-       ssize_t i;
+       int i;
 
        if (!t)
                return -1;
@@ -967,7 +967,7 @@
 mvc_export_file(mvc *m, stream *s, res_table *t) 
 {
        int res = 0;
-       size_t count;
+       BUN count;
        BAT *order = NULL;
 
        if (!t->order) {
@@ -986,7 +986,7 @@
 mvc_export_result(mvc *m, stream *s, int res_id, str w)
 {
        int i, clean = 0, res = 0;
-       size_t count;
+       BUN count;
        res_table *t = res_tables_find(m->results, res_id);
        BAT *order = NULL;
 
@@ -1024,7 +1024,7 @@
                return export_error(order);
 
        /* row count, min(count, reply_size) */
-       if (!mvc_send_int(s, (size_t) m->reply_size < count ? m->reply_size : 
(int) count)) 
+       if (!mvc_send_int(s, (BUN) m->reply_size < count ? m->reply_size : 
(int) count)) 
                return export_error(order);
 
        if (stream_write(s, "\n% ", 3, 1) != 1)
@@ -1095,12 +1095,12 @@
 }
 
 int
-mvc_export_chunk(mvc *m, stream *s, int res_id, size_t offset, size_t nr)
+mvc_export_chunk(mvc *m, stream *s, int res_id, BUN offset, BUN nr)
 {
        int res = 0;
        res_table *t = res_tables_find(m->results, res_id);
        BAT *order = NULL;
-       size_t cnt;
+       BUN cnt;
 
        if (!s || !t)
                return 0;

U sql_user.mx
Index: sql_user.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_user.mx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sql_user.mx 11 Jan 2008 10:51:57 -0000      1.18
+++ sql_user.mx 25 Aug 2008 13:36:15 -0000      1.19
@@ -67,7 +67,7 @@
        size_t user_id;
 
        /* create two SQL statements that insert the user in the SQL
-        * adminsitration */
+        * administration */
        user_id = (size_t)store_next_oid();
        snprintf(buf, BUFSIZ, "INSERT INTO \"sys\".\"db_users\" 
VALUES('%s','%s','%s',%d);", user, passwd, fullname, schema_id);
        list_append(l, stmt_sql(_strdup(buf)));


-------------------------------------------------------------------------
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