Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1792/src/backends/monet5
Modified Files:
sql.mx 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/monet5/sql_result.mx,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- sql_result.mx 29 Jun 2008 21:01:24 -0000 1.91
+++ sql_result.mx 25 Aug 2008 13:36:15 -0000 1.92
@@ -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);
@@ -467,7 +467,7 @@
}
}
if (TABLETcreate_bats(&as, (sz<0)?1000:sz) >= 0) {
- if (TABLETload_file(&as, bs, out) >= 0)
+ if (TABLETload_file(&as, bs, out) != BUN_NONE)
bats = TABLETcollect_bats(&as);
}
if (as.error)
@@ -655,8 +655,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;
@@ -688,11 +688,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 )
{
Tablet as;
Column *fmt;
- ssize_t i;
+ int i;
if (!t)
return -1;
@@ -961,7 +961,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) {
@@ -980,7 +980,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;
@@ -1018,7 +1018,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)
@@ -1089,12 +1089,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/monet5/sql_user.mx,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- sql_user.mx 11 Jan 2008 10:51:58 -0000 1.36
+++ sql_user.mx 25 Aug 2008 13:36:16 -0000 1.37
@@ -120,7 +120,7 @@
BBPunfix(bid);
/* 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_user_info\"
VALUES('%s','%s',%d);", user, fullname, schema_id);
list_append(l, stmt_sql(_strdup(buf)));
U sql.mx
Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -d -r1.276 -r1.277
--- sql.mx 18 Aug 2008 08:48:33 -0000 1.276
+++ sql.mx 25 Aug 2008 13:36:15 -0000 1.277
@@ -1225,7 +1225,8 @@
if (!BATcount(b)) {
BBPunfix(b->batCacheid);
- BBPkeepref( *res = r->batCacheid);
+ BBPkeepref(r->batCacheid);
+ *res = r->batCacheid;
return MAL_SUCCEED;
}
@@ -1258,7 +1259,8 @@
if (sb)
seqbulk_destroy(sb);
BBPunfix(b->batCacheid);
- BBPkeepref( *res = r->batCacheid);
+ BBPkeepref(r->batCacheid);
+ *res = r->batCacheid;
return MAL_SUCCEED;
}
@@ -2069,7 +2071,7 @@
voidbathash(int *res, BAT *b )
{
BAT *dst;
- hash_t (*hash)(ptr v);
+ BUN (*hash)(ptr v);
int *r, *f;
BATiter bi, dsti;
@@ -2100,7 +2102,7 @@
*r++ = (hash(v)) & 0xEFFFFFFF;
}
}
- BATsetcount(dst, r-f);
+ BATsetcount(dst, (BUN) (r-f));
BATkey(BATmirror(dst), 0);
dst->tsorted = 0;
@@ -2113,7 +2115,7 @@
bathash_wrap(int *res, int *bid )
{
BAT *b, *dst;
- hash_t (*hash)(ptr v);
+ BUN (*hash)(ptr v);
BATiter bi;
if( (b = BATdescriptor(*bid)) == NULL ){
@@ -2258,7 +2260,7 @@
char *s = strip_extra_zeros(*val);
char *dot = strchr(s, '.');
int digits = _strlen(s) - 1;
- int scale = digits - (dot-s);
+ int scale = digits - (int) (dot-s);
lng value = 0;
if (!dot) {
-------------------------------------------------------------------------
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