Update of /cvsroot/monetdb/sql/src/storage
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26843/src/storage
Modified Files:
sql_storage.h store.mx
Log Message:
redid most of the bpm storage layer as it needed to be split in snapshot, log
and rollforward
U store.mx
Index: store.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/store.mx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- store.mx 28 Jul 2008 13:25:17 -0000 1.16
+++ store.mx 22 Aug 2008 09:50:30 -0000 1.17
@@ -24,6 +24,7 @@
#include "store_connections.h"
#include "store_sequence.h"
+#include <bat/bat_utils.h>
#include <bat/bat_storage.h>
#include <bat/bat_table.h>
#include <bat/bat_logger.h>
@@ -34,8 +35,8 @@
#include <m4/bpm.h>
-/* version 04.00.00 of catalog */
-#define CATALOG_VERSION 40000
+/* version 04.00.10 of catalog */
+#define CATALOG_VERSION 40010
static MT_Lock bs_lock;
static int store_oid = 0;
@@ -559,7 +560,6 @@
t->pkey = NULL;
t->s = s;
t->sz = COLSIZE;
- t->cnt = 0;
cs_init(&t->columns, (fdestroy) &column_destroy);
cs_init(&t->idxs, (fdestroy) &idx_destroy);
@@ -1097,7 +1097,6 @@
cs_init(&t->triggers, (fdestroy) &trigger_destroy);
t->pkey = NULL;
t->sz = COLSIZE;
- t->cnt = 0;
t->cleared = 0;
t->s = NULL;
return t;
@@ -1168,8 +1167,12 @@
sql_schema *s, *p = NULL;
sql_table *t, *types, *funcs, *args;
sql_trans *tr;
+ int v = 1;
bs_debug = debug;
+
+ /* initialize empty bats */
+ bat_utils_init();
if (store == store_bat) {
bat_storage_init(&store_funcs);
bat_table_init(&table_funcs);
@@ -1189,11 +1192,12 @@
} else if (store == store_bpm) {
bpm_storage_init(&store_funcs);
bpm_table_init(&table_funcs);
- bpm_logger_init(&logger_funcs);
+ bat_logger_init(&logger_funcs);
+ v<<=1;
}
active_store_type = store;
if (!logger_funcs.create ||
- logger_funcs.create(logdir, dbname, CATALOG_VERSION) == LOG_ERR)
+ logger_funcs.create(logdir, dbname, CATALOG_VERSION*v) == LOG_ERR)
return -1;
MT_lock_init(&bs_lock, "SQL_bs_lock");
@@ -1659,7 +1663,6 @@
t->s = s;
t->sz = ot->sz;
- t->cnt = ot->cnt;
t->cleared = 0;
if (ot->columns.set) {
@@ -3475,7 +3478,6 @@
(void)store_funcs.clear_idx(tr, ci);
}
}
- t->cnt = 0;
return sz;
}
U sql_storage.h
Index: sql_storage.h
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/sql_storage.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- sql_storage.h 28 Jul 2008 13:25:17 -0000 1.51
+++ sql_storage.h 22 Aug 2008 09:50:30 -0000 1.52
@@ -104,6 +104,12 @@
typedef void (*delete_tab_fptr) (sql_trans *tr, sql_table *t, void *d, int
tpe);
/*
+-- count number of rows in column (excluding the deletes)
+ */
+typedef size_t (*count_col_fptr) (sql_column *c);
+typedef size_t (*count_idx_fptr) (sql_idx *i);
+
+/*
-- create the necessary storage resources for columns, indices and tables
-- returns LOG_OK, LOG_ERR
*/
@@ -169,6 +175,9 @@
update_idx_fptr update_idx;
delete_tab_fptr delete_tab;
+ count_col_fptr count_col;
+ count_idx_fptr count_idx;
+
create_col_fptr create_col;
create_idx_fptr create_idx;
create_del_fptr create_del;
-------------------------------------------------------------------------
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