Update of /cvsroot/monetdb/sql/src/storage
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1792/src/storage
Modified Files:
sql_storage.h store.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 store.mx
Index: store.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/store.mx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- store.mx 22 Aug 2008 09:50:30 -0000 1.17
+++ store.mx 25 Aug 2008 13:36:19 -0000 1.18
@@ -907,7 +907,7 @@
static sqlid
next_oid(void)
{
- lng id = 0;
+ int id = 0;
MT_set_lock(bs_lock, "next_oid");
id = store_oid++;
MT_unset_lock(bs_lock, "next_oid");
@@ -3450,12 +3450,12 @@
}
}
-size_t
+BUN
sql_trans_clear_table(sql_trans *tr, sql_table *t)
{
node *n = t->columns.set->h;
sql_column *c = n->data;
- size_t sz = 0;
+ BUN sz = 0;
t->cleared = 1;
t->base.wtime = t->s->base.wtime = tr->wtime = tr->stime;
@@ -4013,7 +4013,7 @@
table_funcs.column_update_value(tr, c, rid, &seq->cacheinc);
}
if (seq->cycle != cycle) {
- seq->cycle = cycle;
+ seq->cycle = cycle != 0;
changed = 1;
c = find_sql_column(seqs, "cycle");
table_funcs.column_update_value(tr, c, rid, &seq->cycle);
U sql_storage.h
Index: sql_storage.h
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/sql_storage.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- sql_storage.h 22 Aug 2008 09:50:30 -0000 1.52
+++ sql_storage.h 25 Aug 2008 13:36:18 -0000 1.53
@@ -53,7 +53,7 @@
typedef int (*table_delete_fptr)(sql_trans *tr, sql_table *t, ssize_t rid);
typedef struct rids {
- size_t cur;
+ BUN cur;
void *data;
} rids;
@@ -137,9 +137,9 @@
-- clear any storage resources for columns, indices and tables
-- returns number of removed tuples
*/
-typedef size_t (*clear_col_fptr) (sql_trans *tr, sql_column *c);
-typedef size_t (*clear_idx_fptr) (sql_trans *tr, sql_idx *i);
-typedef size_t (*clear_del_fptr) (sql_trans *tr, sql_table *t);
+typedef BUN (*clear_col_fptr) (sql_trans *tr, sql_column *c);
+typedef BUN (*clear_idx_fptr) (sql_trans *tr, sql_idx *i);
+typedef BUN (*clear_del_fptr) (sql_trans *tr, sql_table *t);
/*
-- update_table rollforward the changes made from table ft to table tt
@@ -303,7 +303,7 @@
extern sql_table *sql_trans_create_table(sql_trans *tr, sql_schema *s, char
*name, char *sql, int tt, bit system, int persistence, int commit_action, int
sz);
extern void sql_trans_drop_table(sql_trans *tr, sql_schema *s, int id, int
drop_action);
-extern size_t sql_trans_clear_table(sql_trans *tr, sql_table *t);
+extern BUN sql_trans_clear_table(sql_trans *tr, sql_table *t);
extern sql_column *create_sql_column(sql_table *t, char *nme, sql_subtype
*tpe);
extern sql_column *sql_trans_create_column(sql_trans *tr, sql_table *t, char
*name, sql_subtype *tpe);
-------------------------------------------------------------------------
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