Changeset: 24bdee5434da for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24bdee5434da
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.mx
        sql/common/sql_list.c
Branch: default
Log Message:

cleanup readonly/debug from the past..


diffs (75 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -714,10 +714,9 @@ static stmt *check_types(mvc *sql, sql_s
 static stmt *
 stmt_col( mvc *sql, sql_column *c, stmt *del) 
 { 
-       int readonly = (mvc_debug_on(sql, 32) || mvc_debug_on(sql, 64) || 
mvc_debug_on(sql, 8192));
        stmt *sc = stmt_bat(sql->sa, c, RDONLY);
 
-       if (isTable(c->t) && !c->t->readonly && !readonly &&
+       if (isTable(c->t) && !c->t->readonly &&
           (c->base.flag != TR_NEW || c->t->base.flag != TR_NEW /* alter */) &&
           (c->t->persistence == SQL_PERSIST || c->t->persistence == 
SQL_DECLARED_TABLE) && !c->t->commit_action) {
                stmt *i = stmt_bat(sql->sa, c, RD_INS);
@@ -733,10 +732,9 @@ stmt_col( mvc *sql, sql_column *c, stmt 
 static stmt *
 stmt_idx( mvc *sql, sql_idx *i, stmt *del) 
 { 
-       int readonly = (mvc_debug_on(sql, 32) || mvc_debug_on(sql, 64) || 
mvc_debug_on(sql, 8192));
        stmt *sc = stmt_idxbat(sql->sa, i, RDONLY);
 
-       if (isTable(i->t) && !i->t->readonly && !readonly &&
+       if (isTable(i->t) && !i->t->readonly &&
           (i->base.flag != TR_NEW || i->t->base.flag != TR_NEW /* alter */) &&
           (i->t->persistence == SQL_PERSIST || i->t->persistence == 
SQL_DECLARED_TABLE) && !i->t->commit_action) {
                stmt *ic = stmt_idxbat(sql->sa, i, RD_INS);
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -3717,12 +3717,10 @@ SQLtid(Client cntxt, MalBlkPtr mb, MalSt
        sql_column *c;
        BAT *tids;
        size_t nr, sb = 0, inr = 0;
-       int readonly = 0;
 
        *res = 0;
        if (msg)
                return msg;
-       readonly = (mvc_debug_on(m, 32) || mvc_debug_on(m, 64) || 
mvc_debug_on(m, 8192));
        s = mvc_bind_schema(m, sname);
        if ( s == NULL)
                throw(SQL,"sql.tid","3F000!Schema missing");
@@ -3733,7 +3731,7 @@ SQLtid(Client cntxt, MalBlkPtr mb, MalSt
 
        nr = store_funcs.count_col(tr, c, 1);
 
-       if (isTable(t) && !readonly &&
+       if (isTable(t) && !t->readonly &&
           (t->base.flag != TR_NEW /* alter */) &&
            t->persistence == SQL_PERSIST && !t->commit_action) 
                inr = store_funcs.count_col(tr, c, 0);
diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- a/sql/common/sql_list.c
+++ b/sql/common/sql_list.c
@@ -279,9 +279,16 @@ list_find(list *l, void *key, fcmp cmp)
        node *n = NULL;
 
        if (key) {
-               for (n = l->h; n; n = n->next) {
-                       if (cmp(n->data, key) == 0) {
-                               return n;
+               if (cmp) {
+                       for (n = l->h; n; n = n->next) {
+                               if (cmp(n->data, key) == 0) {
+                                       return n;
+                               }
+                       }
+               } else {
+                       for (n = l->h; n; n = n->next) {
+                               if (n->data == key) 
+                                       return n;
                        }
                }
        }
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to