Changeset: 43c17249aa69 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43c17249aa69
Modified Files:
        sql/storage/store.c
Branch: Nov2019
Log Message:

make sure we don't validate queries which update already dropped tables


diffs (48 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4065,13 +4065,18 @@ validate_tables(sql_schema *s, sql_schem
        if (cs_size(&s->tables))
                for (n = s->tables.set->h; n; n = n->next) {
                        sql_table *t = n->data;
-                       sql_table *ot;
+                       sql_table *ot = NULL;
 
                        if (!t->base.wtime && !t->base.rtime)
                                continue;
 
-                       ot = find_sql_table(os, t->base.name);
-                       if (ot && isKindOfTable(ot) && isKindOfTable(t)) {
+                       o =     list_find_base_id(os->tables.set, t->base.id);
+                       if (o)
+                               ot = o->data;
+                       if (!ot && os->tables.dset && 
list_find_base_id(os->tables.dset, t->base.id) != NULL) {
+                               /* dropped table */
+                               return 0;
+                       } else if (ot && isKindOfTable(ot) && isKindOfTable(t) 
&& !isDeclaredTable(ot) && !isDeclaredTable(t)) {
                                if ((t->base.wtime && (t->base.wtime < 
ot->base.rtime || t->base.wtime < ot->base.wtime)) ||
                                    (t->base.rtime && (t->base.rtime < 
ot->base.wtime))) 
                                        return 0;
@@ -4288,7 +4293,8 @@ reset_table(sql_trans *tr, sql_table *ft
                ft->access = pft->access;
                if (pft->p) {
                        ft->p = find_sql_table(ft->s, pft->p->base.name);
-                       assert(isMergeTable(ft->p) || isReplicaTable(ft->p));
+                       //the parent (merge or replica table) maybe created 
later!
+                       //assert(isMergeTable(ft->p) || isReplicaTable(ft->p));
                } else
                        ft->p = NULL;
 
@@ -4379,6 +4385,12 @@ reset_trans(sql_trans *tr, sql_trans *pt
 #ifdef STORE_DEBUG
        fprintf(stderr,"#reset trans %d\n", tr->wtime);
 #endif
+
+       for (node *n = tr->schemas.set->h; n; n = n->next) { /* Set table 
members */
+               sql_schema *s = n->data;
+
+               set_members(&s->tables);
+       }
        return res;
 }
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to