Changeset: 34ccf94b43c1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/34ccf94b43c1
Modified Files:
        sql/storage/bat/bat_table.c
        sql/storage/sql_storage.h
Branch: Jul2021
Log Message:

removed old vacuum code...


diffs (95 lines):

diff --git a/sql/storage/bat/bat_table.c b/sql/storage/bat/bat_table.c
--- a/sql/storage/bat/bat_table.c
+++ b/sql/storage/bat/bat_table.c
@@ -579,64 +579,6 @@ rids_diff(sql_trans *tr, rids *l, sql_co
        return l;
 }
 
-static int
-table_vacuum(sql_trans *tr, sql_table *t)
-{
-       sqlstore *store = tr->store;
-       BAT *tids = delta_cands(tr, t);
-       BAT **cols;
-       node *n;
-       size_t cnt = 0;
-
-       if (!tids)
-               return SQL_ERR;
-       cnt = BATcount(tids);
-       cols = NEW_ARRAY(BAT*, ol_length(t->columns));
-       if (!cols) {
-               bat_destroy(tids);
-               return SQL_ERR;
-       }
-       for (n = ol_first_node(t->columns); n; n = n->next) {
-               sql_column *c = n->data;
-               BAT *v = store->storage_api.bind_col(tr, c, RDONLY);
-
-               if (v == NULL ||
-                   (cols[c->colnr] = BATproject(tids, v)) == NULL) {
-                       BBPunfix(tids->batCacheid);
-                       for (n = ol_first_node(t->columns); n; n = n->next) {
-                               if (n->data == c)
-                                       break;
-                               bat_destroy(cols[((sql_column *) 
n->data)->colnr]);
-                       }
-                       bat_destroy(v);
-                       _DELETE(cols);
-                       return SQL_ERR;
-               }
-               BBPunfix(v->batCacheid);
-       }
-       BBPunfix(tids->batCacheid);
-       sql_trans_clear_table(tr, t);
-       size_t offset = store->storage_api.claim_tab(tr, t, cnt);
-       assert(offset == 0);
-       for (n = ol_first_node(t->columns); n; n = n->next) {
-               sql_column *c = n->data;
-               int ok;
-
-               ok = store->storage_api.append_col(tr, c, offset, 
cols[c->colnr], TYPE_bat, 0);
-               BBPunfix(cols[c->colnr]->batCacheid);
-               if (ok != LOG_OK) {
-                       for (n = n->next; n; n = n->next) {
-                               c = n->data;
-                               BBPunfix(cols[c->colnr]->batCacheid);
-                       }
-                       _DELETE(cols);
-                       return SQL_ERR;
-               }
-       }
-       _DELETE(cols);
-       return SQL_OK;
-}
-
 void
 bat_table_init( table_functions *tf )
 {
@@ -652,7 +594,6 @@ bat_table_init( table_functions *tf )
        tf->column_update_value = column_update_value;
        tf->table_insert = table_insert;
        tf->table_delete = table_delete;
-       tf->table_vacuum = table_vacuum;
 
        tf->rids_select = rids_select;
        tf->rids_orderby = rids_orderby;
diff --git a/sql/storage/sql_storage.h b/sql/storage/sql_storage.h
--- a/sql/storage/sql_storage.h
+++ b/sql/storage/sql_storage.h
@@ -50,7 +50,6 @@ typedef void (*column_find_string_end_fp
 typedef int (*column_update_value_fptr)(sql_trans *tr, sql_column *c, oid rid, 
void *value);
 typedef int (*table_insert_fptr)(sql_trans *tr, sql_table *t, ...);
 typedef int (*table_delete_fptr)(sql_trans *tr, sql_table *t, oid rid);
-typedef int (*table_vacuum_fptr)(sql_trans *tr, sql_table *t);
 
 typedef struct rids {
        BUN cur;
@@ -103,7 +102,6 @@ typedef struct table_functions {
        column_update_value_fptr column_update_value;
        table_insert_fptr table_insert;
        table_delete_fptr table_delete;
-       table_vacuum_fptr table_vacuum;
 
        rids_select_fptr rids_select;
        rids_orderby_fptr rids_orderby;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to