what is interesting is not from where you are pushing the changes but
what the changes do:))
On Wed, Oct 30, 2013 at 10:30 AM, Rene Tassy
Changeset: fb471128db99 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb471128db99 Modified Files: sql/storage/bat/bat_storage.c Branch: newstorage Log Message:
pushing changes from laptop
diffs (144 lines):
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c --- a/sql/storage/bat/bat_storage.c +++ b/sql/storage/bat/bat_storage.c @@ -41,6 +41,14 @@ timestamp_dbat( sql_dbat *d, int ts) return d; }
+/**static sql_timestamps * +timestamp_tsbats(sql_timestamps *ts, int timestamp) { + + while (ts->next && ts->wtime > timestamp) + ts = ts->next; + return ts; +}*/ +
static BAT * delta_bind_del(sql_dbat *bat, int access) @@ -1222,16 +1230,6 @@ load_timestamps(sql_timestamps *ts, int }
static int -load_dbat(sql_dbat *bat, int bid) { - - BAT *b = quick_descriptor(bid); - - bat->dbid = temp_create(b); - bat->cnt = BATcount(b); - return LOG_OK; -} - -static int create_timestamps(sql_trans *tr, sql_table *t) {
int ok = LOG_OK; @@ -1275,6 +1273,16 @@ create_timestamps(sql_trans *tr, sql_tab }
static int +load_dbat(sql_dbat *bat, int bid) { + + BAT *b = quick_descriptor(bid); + + bat->dbid = temp_create(b); + bat->cnt = BATcount(b); + return LOG_OK; +} + +static int create_del(sql_trans *tr, sql_table *t) { int ok = LOG_OK; @@ -1369,8 +1377,7 @@ static int snapshot_create_del(sql_trans *tr, sql_table *t) { sql_dbat *bat = t->data; - BAT *b = temp_descriptor(bat->dbid); - //BAT *trdb = temp_descriptor(bat->dtrbid); + BAT *b = temp_descriptor(bat->dbid);;
printf("in snapshot_create_del\n");
@@ -1383,13 +1390,6 @@ snapshot_create_del(sql_trans *tr, sql_t BATmmap(b, STORE_MMAP, STORE_MMAP, STORE_MMAP, STORE_MMAP, 0); bat_destroy(b);
- /*bat_set_access(trdb, BAT_READ); - if (BATcount(trdb) > SNAPSHOT_MINSIZE) - BATmode(trdb, PERSISTENT); - if (BATcount(trdb) > (BUN) REMAP_PAGE_MAXSIZE) - BATmmap(trdb, STORE_MMAP, STORE_MMAP, STORE_MMAP, STORE_MMAP, 0); - bat_destroy(trdb);*/ - return LOG_OK; }
@@ -1539,16 +1539,12 @@ destroy_dbat(sql_trans *tr, sql_dbat *ba
if (bat->dname) _DELETE(bat->dname); - //if (bat->dtrname) - //_DELETE(bat->dtrname); + if (bat->dbid) temp_destroy(bat->dbid); - //if (bat->dtrbid) - //temp_destroy(bat->dtrbid); + bat->dbid = 0; bat->dname = NULL; - //bat->dtrbid = 0; - //bat->dtrname = NULL; _DELETE(bat); if (n) return destroy_dbat(tr, n); @@ -1798,20 +1794,39 @@ clear_dbat(sql_trans *tr, sql_dbat *bat) BATcommit(b); bat_destroy(b); } - /*if(bat->dtrbid) { - BAT *b = temp_descriptor(bat->dtrbid); - - sz+= BATcount(b); - bat_clear(b); - BATcommit(b); - bat_destroy(b); - }*/ + bat->cnt = 0; bat->wtime = tr->wstime;
return sz; } - +/** +static BUN +clear_tsbats(sql_trans *tr, sql_timestamps *ts) { + + BUN sz =0; + + (void)tr; + if(ts->insbid) { + BAT *b = temp_descriptor(ts->insbid); + + sz += BATcount(b) + } +} + +static BUN +clear_timestamps(sql_trans *tr, sql_table *t) { + + if(!t->timestamps || !t->base.allocated) { + sql_table *ot = tr_find_table(tr->parent, t); + sql_timestamps *ts = t->timestamps = ZNEW(sql_timestamps), *ots = timestamp_tsbats(ots->timestamps, tr->stime); + dup_tsbats(tr, ts, ots, isNew(ot), isTempTable(t)); + t->base.allocated = 1; + } + + return clear_tsbats(tr, t->timestamps); +} +*/ static BUN clear_del(sql_trans *tr, sql_table *t) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list