Changeset: ba3976807c42 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ba3976807c42
Modified Files:
        sql/backends/monet5/sql_cat.c
Branch: strimps_update
Log Message:

Cleanup


diffs (37 lines):

diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -746,9 +746,6 @@ IDXdrop(mvc *sql, const char *sname, con
                        throw(SQL,"sql.drop_index", SQLSTATE(HY005) "Column can 
not be accessed");
        }
 
-       /* TODO: This should be removed when strimps are better integrated with 
imprints */
-       if (func == IMPSdestroy && b->ttype == TYPE_str)
-               func = STRMPdestroy;
        func(b);
        BBPunfix(b->batCacheid);
        return MAL_SUCCEED;
@@ -771,7 +768,8 @@ drop_index(mvc *sql, char *sname, char *
                throw(SQL,"sql.drop_index", SQLSTATE(42S12) "DROP INDEX: cannot 
drop index '%s', because the constraint '%s' depends on it", iname, 
i->key->base.name);
        if (i->type == ordered_idx || i->type == imprints_idx) {
                sql_kc *ic = i->columns->h->data;
-               if ((msg = IDXdrop(sql, s->base.name, ic->c->t->base.name, 
ic->c->base.name, i->type == ordered_idx ? OIDXdestroy : IMPSdestroy)))
+               sql_class icls = ic->c->type.type->eclass;
+               if ((msg = IDXdrop(sql, s->base.name, ic->c->t->base.name, 
ic->c->base.name, i->type == ordered_idx ? OIDXdestroy : (icls == EC_STRING ? 
STRMPdestroy : IMPSdestroy))))
                        return msg;
        }
        switch (mvc_drop_idx(sql, s, i)) {
@@ -1283,8 +1281,11 @@ alter_table(Client cntxt, mvc *sql, char
                                                
throw(SQL,"sql.alter_table",SQLSTATE(HY005) "Cannot access imprints index 
%s_%s_%s", s->base.name, t->base.name, i->base.name);
                                }
                                if(b->ttype == TYPE_str) {
-                                       /* if (t->access != TABLE_READONLY) */
-                                       /*      throw(SQL, "sql.alter_TABLE", 
SQLSTATE(HY005) "Cannot create string imprint index %s on non read only table 
%s.%s", i->base.name, s->base.name, t->base.name); */
+                                       if (t->access != TABLE_READONLY) {
+                                               BBPunfix(b->batCacheid);
+                                               throw(SQL, "sql.alter_TABLE", 
SQLSTATE(HY005) "Cannot create string imprint index %s on non read only table 
%s.%s", i->base.name, s->base.name, t->base.name);
+                                       }
+
                                        r = BATsetstrimps(b);
                                }
                                else {
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to