Changeset: e0e572a2a00f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0e572a2a00f
Modified Files:
        gdk/gdk.h
        gdk/gdk_bbp.c
        gdk/gdk_logger.c
        sql/storage/bat/bat_logger.c
Branch: default
Log Message:

Removed old upgrade code.


diffs (249 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -894,8 +894,6 @@ typedef struct {
 /* assert that atom width is power of 2, i.e., width == 1<<shift */
 #define assert_shift_width(shift,width) assert(((shift) == 0 && (width) == 0) 
|| ((unsigned)1<<(shift)) == (unsigned)(width))
 
-#define GDKLIBRARY_INET_COMPARE        061026  /* version with missing inet 
cmp func */
-#define GDKLIBRARY_64_BIT_INT  061027  /* version that had no 128-bit integer 
option, yet */
 #define GDKLIBRARY_SORTEDPOS   061030  /* version where we can't trust 
no(rev)sorted */
 #define GDKLIBRARY_OLDWKB      061031  /* old geom WKB format */
 #define GDKLIBRARY_INSERTED    061032  /* inserted and deleted in BBP.dir */
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1000,13 +1000,6 @@ heapinit(COLrec *col, const char *buf, i
        col->heap.newstorage = (storage_t) storage;
        col->heap.farmid = BBPselectfarm(PERSISTENT, col->type, offheap);
        col->heap.dirty = 0;
-       if (bbpversion <= GDKLIBRARY_INET_COMPARE &&
-           strcmp(type, "inet") == 0) {
-               /* don't trust ordering information on inet columns */
-               col->sorted = 0;
-               col->revsorted = 0;
-               col->nosorted = col->norevsorted = 0;
-       }
        if (col->heap.free > col->heap.size)
                GDKfatal("BBPinit: \"free\" value larger than \"size\" in heap 
of bat %d\n", (int) bid);
        return n;
@@ -1216,7 +1209,6 @@ BBPheader(FILE *fp, oid *BBPoid, int *OI
        }
        if (bbpversion != GDKLIBRARY &&
            bbpversion != GDKLIBRARY_SORTEDPOS &&
-           bbpversion != GDKLIBRARY_64_BIT_INT &&
            bbpversion != GDKLIBRARY_OLDWKB &&
            bbpversion != GDKLIBRARY_INSERTED) {
                GDKfatal("BBPinit: incompatible BBP version: expected 0%o, got 
0%o.", GDKLIBRARY, bbpversion);
@@ -1224,15 +1216,8 @@ BBPheader(FILE *fp, oid *BBPoid, int *OI
        if (fgets(buf, sizeof(buf), fp) == NULL) {
                GDKfatal("BBPinit: short BBP");
        }
-       if (bbpversion <= GDKLIBRARY_64_BIT_INT) {
-               if (sscanf(buf, "%d %d", &ptrsize, &oidsize) != 2) {
-                       GDKfatal("BBPinit: BBP.dir has incompatible format: 
pointer and OID sizes are missing");
-               }
-               intsize = SIZEOF_LNG;
-       } else {
-               if (sscanf(buf, "%d %d %d", &ptrsize, &oidsize, &intsize) != 3) 
{
-                       GDKfatal("BBPinit: BBP.dir has incompatible format: 
pointer, OID, and max. integer sizes are missing");
-               }
+       if (sscanf(buf, "%d %d %d", &ptrsize, &oidsize, &intsize) != 3) {
+               GDKfatal("BBPinit: BBP.dir has incompatible format: pointer, 
OID, and max. integer sizes are missing");
        }
        if (ptrsize != SIZEOF_SIZE_T || oidsize != SIZEOF_OID) {
 #if SIZEOF_SIZE_T == 8 && SIZEOF_OID == 8
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1492,6 +1492,10 @@ logger_load(int debug, const char* fn, c
                if (n == 0)
                        logger_fatal("logger_load: inconsistent database, 
catalog_nme does not exist", 0, 0, 0);
 
+               if (!BAThdense(b) || !BAThdense(n))
+                       logger_fatal("logger_load: ancient database, please "
+                                    "upgrade first to Jul2015 (11.21.X) or "
+                                    "Jun2016 (11.23.X) release", 0, 0, 0);
                snprintf(bak, sizeof(bak), "%s_dcatalog", fn);
                dcatalog = BBPindex(bak);
                d = BATdescriptor(dcatalog);
@@ -1506,46 +1510,6 @@ logger_load(int debug, const char* fn, c
                        BBPincref(d->batCacheid, TRUE);
                        if (BBPrename(d->batCacheid, bak) < 0)
                                logger_fatal("logger_load: BBPrename to %s 
failed", bak, 0, 0);
-/* LEGACY */
-                       if (!BAThdense(b) || !BAThdense(n)) {
-                               /* we need to convert catalog_bid and
-                                * catalog_nme to be dense-headed; we
-                                * do this by replacing the two with
-                                * new, dense versions */
-                               BATiter bi, ni;
-                               BUN r;
-                               BAT *b2, *n2;
-                               bat list[5];
-
-                               list[0] = 0;
-                               list[1] = b->batCacheid;
-                               list[2] = n->batCacheid;
-                               if ((b2 = logbat_new(b->ttype, BATSIZE, 
PERSISTENT)) == NULL)
-                                       logger_fatal("logger_load: cannot 
create BAT", 0, 0, 0);
-                               if ((n2 = logbat_new(n->ttype, BATSIZE, 
PERSISTENT)) == NULL)
-                                       logger_fatal("logger_load: cannot 
create BAT", 0, 0, 0);
-                               list[3] = b2->batCacheid;
-                               list[4] = n2->batCacheid;
-                               logger_switch_bat(b, b2, fn, "catalog_bid");
-                               logger_switch_bat(n, n2, fn, "catalog_nme");
-                               bi = bat_iterator(b);
-                               ni = bat_iterator(n);
-                               BATloop(b, p, q) {
-                                       oid o = ((const oid *) 
b->H->heap.base)[p];
-                                       r = BUNfnd(BATmirror(n), &o);
-                                       if (r != BUN_NONE) {
-                                               if (BUNappend(b2, BUNtloc(bi, 
p), 0) != GDK_SUCCEED ||
-                                                   BUNappend(n2, BUNtvar(ni, 
r), 0) != GDK_SUCCEED)
-                                                       
logger_fatal("logger_load: cannot append to new catalog BATs", 0, 0, 0);
-                                       }
-                               }
-                               BBPunfix(b->batCacheid);
-                               BBPunfix(n->batCacheid);
-                               b = b2;
-                               n = n2;
-                               if (TMsubcommit_list(list, 5) != GDK_SUCCEED)
-                                       logger_fatal("logger_load: committing 
new catalog_bid/catalog_nme failed", 0, 0, 0);
-                       }
                }
 
                /* the catalog exists, and so should the log file */
diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c
--- a/sql/storage/bat/bat_logger.c
+++ b/sql/storage/bat/bat_logger.c
@@ -17,21 +17,9 @@ logger *bat_logger_shared = NULL;
 static int
 bl_preversion( int oldversion, int newversion)
 {
-#define CATALOG_OCT2014 52100
-#define CATALOG_OCT2014SP3 52101
 #define CATALOG_JUL2015 52200
 
        (void)newversion;
-       if (oldversion == CATALOG_OCT2014SP3) {
-               catalog_version = oldversion;
-               geomversion_set();
-               return 0;
-       }
-       if (oldversion == CATALOG_OCT2014) {
-               catalog_version = oldversion;
-               geomversion_set();
-               return 0;
-       }
        if (oldversion == CATALOG_JUL2015) {
                catalog_version = oldversion;
                geomversion_set();
@@ -55,107 +43,6 @@ static void
 bl_postversion( void *lg) 
 {
        (void)lg;
-       if (catalog_version <= CATALOG_OCT2014) {
-               BAT *te, *tn, *tne;
-               BATiter tei, tni;
-               char *s = "sys", n[64];
-               BUN p,q;
-
-               te = temp_descriptor(logger_find_bat(lg, N(n, NULL, s, 
"types_eclass")));
-               tn = temp_descriptor(logger_find_bat(lg, N(n, NULL, s, 
"types_sqlname")));
-               if (!te || !tn)
-                       return;
-               tei = bat_iterator(te);
-               tni = bat_iterator(tn);
-               tne = BATnew(TYPE_void, TYPE_int, BATcount(te), PERSISTENT);
-               if (!tne)
-                       return;
-               BATseqbase(tne, te->hseqbase);
-               for(p=BUNfirst(te), q=BUNlast(te); p<q; p++) {
-                       int eclass = *(int*)BUNtail(tei, p);
-                       char *name = BUNtail(tni, p);
-
-                       if (eclass == EC_POS)           /* old EC_NUM */
-                               eclass = strcmp(name, "oid") == 0 ? EC_POS : 
EC_NUM;
-                       else if (eclass == EC_NUM)      /* old EC_INTERVAL */
-                               eclass = strcmp(name, "sec_interval") == 0 ? 
EC_SEC : EC_MONTH;
-                       else if (eclass >= EC_MONTH)    /* old EC_DEC */
-                               eclass += 2;
-                       BUNappend(tne, &eclass, TRUE);
-               }
-               BATsetaccess(tne, BAT_READ);
-               logger_add_bat(lg, tne, N(n, NULL, s, "types_eclass"));
-               bat_destroy(te);
-               bat_destroy(tn);
-       } else if (catalog_version == CATALOG_OCT2014SP3) {
-               BAT *te, *tn, *tne;
-               BATiter tei, tni;
-               char *s = "sys", n[64];
-               BUN p,q;
-
-               te = temp_descriptor(logger_find_bat(lg, N(n, NULL, s, 
"types_eclass")));
-               tn = temp_descriptor(logger_find_bat(lg, N(n, NULL, s, 
"types_sqlname")));
-               if (!te || !tn)
-                       return;
-               tei = bat_iterator(te);
-               tni = bat_iterator(tn);
-               tne = BATnew(TYPE_void, TYPE_int, BATcount(te), PERSISTENT);
-               if (!tne)
-                       return;
-               BATseqbase(tne, te->hseqbase);
-               for(p=BUNfirst(te), q=BUNlast(te); p<q; p++) {
-                       int eclass = *(int*)BUNtail(tei, p);
-                       char *name = BUNtail(tni, p);
-
-                       if (eclass == EC_MONTH)         /* old EC_INTERVAL */
-                               eclass = strcmp(name, "sec_interval") == 0 ? 
EC_SEC : EC_MONTH;
-                       else if (eclass >= EC_SEC)      /* old EC_DEC */
-                               eclass += 1;
-                       BUNappend(tne, &eclass, TRUE);
-               }
-               BATsetaccess(tne, BAT_READ);
-               logger_add_bat(lg, tne, N(n, NULL, s, "types_eclass"));
-               bat_destroy(te);
-               bat_destroy(tn);
-       }
-       if (catalog_version == CATALOG_OCT2014 ||
-           catalog_version == CATALOG_OCT2014SP3) {
-               /* we need to replace tables.readonly by tables.access column */
-               BAT *b, *b1;
-               BATiter bi;
-               char *s = "sys", n[64];
-               BUN p,q;
-
-               while(s) {
-                       b = temp_descriptor(logger_find_bat(lg, N(n, NULL, s, 
"_tables_readonly")));
-                       if (!b)
-                               return;
-                       bi = bat_iterator(b);
-                       b1 = BATnew(TYPE_void, TYPE_sht, BATcount(b), 
PERSISTENT);
-                       if (!b1)
-                               return;
-                       BATseqbase(b1, b->hseqbase);
-
-                       bi = bat_iterator(b);
-                       for(p=BUNfirst(b), q=BUNlast(b); p<q; p++) {
-                               bit ro = *(bit*)BUNtail(bi, p);
-                               sht access = 0;
-                               if (ro)
-                                       access = TABLE_READONLY;
-                               BUNappend(b1, &access, TRUE);
-                       }
-                       BATsetaccess(b1, BAT_READ);
-                       logger_add_bat(lg, b1, N(n, NULL, s, "_tables_access"));
-                       /* delete functions.sql */
-                       logger_del_bat(lg, b->batCacheid);
-                       bat_destroy(b);
-                       bat_destroy(b1);
-                       if (strcmp(s,"sys")==0)
-                               s = "tmp";
-                       else
-                               s = NULL;
-               }
-       }
 
        if (catalog_version <= CATALOG_JUL2015) {
                BAT *b;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to