Changeset: 8f10367ee2b6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8f10367ee2b6
Modified Files:
        sql/storage/store.c
        sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
        
sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
        sql/test/miscellaneous/Tests/groupby_error.stable.out
Branch: oscar
Log Message:

Merged with Jun2020


diffs (124 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4612,13 +4612,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) && 
!isDeclaredTable(ot) && !isDeclaredTable(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;
@@ -4877,7 +4882,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;
 
@@ -4986,6 +4992,12 @@ reset_trans(sql_trans *tr, sql_trans *pt
 {
        int res = reset_changeset(tr, &tr->schemas, &ptr->schemas, (sql_base 
*)tr->parent, (resetf) &reset_schema, (dupfunc) &schema_dup);
        TRC_DEBUG(SQL_STORE, "Reset transaction: %d\n", tr->wtime);
+
+       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;
 }
 
diff --git a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out 
b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
--- a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
+++ b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
@@ -97,7 +97,7 @@ single project (
 | ) [ "o"."open_auction_id" NOT NULL * = "%32"."%32" NOT NULL ]
 ) [ "o"."id" NOT NULL HASHCOL , "o"."open_auction_id" NOT NULL, "o"."initial" 
NOT NULL, "o"."reserve" NOT NULL, "o"."aktuell" NOT NULL, "o"."privacy" NOT 
NULL, "o"."itemref" NOT NULL, "o"."seller" NOT NULL, "o"."quantity" NOT NULL, 
"o"."type" NOT NULL, "o"."start" NOT NULL, "o"."ende" NOT NULL, "o"."%TID%" NOT 
NULL, "b"."id" NOT NULL HASHCOL , "b"."open_auction_id" NOT NULL, "b"."date" 
NOT NULL, "b"."time" NOT NULL, "b"."personref" NOT NULL, "b"."increase" NOT 
NULL, "b"."%TID%" NOT NULL, "b3"."increase" NOT NULL as "%2"."%2" ]
 project (
-| select (
+| single select (
 | | single join (
 | | | & REF 2 ,
 | | | project (
diff --git 
a/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
 
b/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
@@ -92,29 +92,25 @@ project (
 | | | | | project (
 | | | | | | project (
 | | | | | | | project (
-| | | | | | | | project (
-| | | | | | | | | project (
-| | | | | | | | | | left outer join (
-| | | | | | | | | | | left outer join (
-| | | | | | | | | | | | join (
-| | | | | | | | | | | | | join (
-| | | | | | | | | | | | | | table(sys.functions) [ "functions"."id" as 
"f"."id", "functions"."schema_id" as "f"."schema_id" ] COUNT ,
-| | | | | | | | | | | | | | table(sys.comments) [ "comments"."id" NOT NULL 
HASHCOL  as "c"."id" ] COUNT 
-| | | | | | | | | | | | | ) [ "f"."id" = "c"."id" NOT NULL HASHCOL  ],
-| | | | | | | | | | | | | table(sys.schemas) [ "schemas"."id" as "s"."id" ] 
COUNT 
-| | | | | | | | | | | | ) [ "f"."schema_id" = "s"."id" ],
-| | | | | | | | | | | | select (
-| | | | | | | | | | | | | table(sys.functions) [ "functions"."id", 
"functions"."system" ] COUNT 
-| | | | | | | | | | | | ) [ "functions"."system" = boolean "true" ]
-| | | | | | | | | | | ) [ "f"."id" = "functions"."id" ],
-| | | | | | | | | | | select (
-| | | | | | | | | | | | table(sys.args) [ "args"."func_id" as "p"."func_id", 
"args"."inout" as "p"."inout", "args"."number" as "p"."number" ] COUNT 
-| | | | | | | | | | | ) [ "p"."inout" = tinyint "1" ]
-| | | | | | | | | | ) [ "f"."id" = "p"."func_id" ]
-| | | | | | | | | ) [ "f"."id", "p"."number" ] [ "f"."id" ASC, "p"."number" 
ASC ]
-| | | | | | | | ) [ "f"."id", "p"."number" ]
-| | | | | | | ) [ "f"."id", "p"."number" ] [ "f"."id" ASC, "p"."number" NULLS 
LAST ]
-| | | | | | ) [ "f"."id", "p"."number" ]
+| | | | | | | | left outer join (
+| | | | | | | | | left outer join (
+| | | | | | | | | | join (
+| | | | | | | | | | | join (
+| | | | | | | | | | | | table(sys.functions) [ "functions"."id" as "f"."id", 
"functions"."schema_id" as "f"."schema_id" ] COUNT ,
+| | | | | | | | | | | | table(sys.comments) [ "comments"."id" NOT NULL HASHCOL 
 as "c"."id" ] COUNT 
+| | | | | | | | | | | ) [ "f"."id" = "c"."id" NOT NULL HASHCOL  ],
+| | | | | | | | | | | table(sys.schemas) [ "schemas"."id" as "s"."id" ] COUNT 
+| | | | | | | | | | ) [ "f"."schema_id" = "s"."id" ],
+| | | | | | | | | | select (
+| | | | | | | | | | | table(sys.functions) [ "functions"."id", 
"functions"."system" ] COUNT 
+| | | | | | | | | | ) [ "functions"."system" = boolean "true" ]
+| | | | | | | | | ) [ "f"."id" = "functions"."id" ],
+| | | | | | | | | select (
+| | | | | | | | | | table(sys.args) [ "args"."func_id" as "p"."func_id", 
"args"."inout" as "p"."inout", "args"."number" as "p"."number" ] COUNT 
+| | | | | | | | | ) [ "p"."inout" = tinyint "1" ]
+| | | | | | | | ) [ "f"."id" = "p"."func_id" ]
+| | | | | | | ) [ "f"."id", "p"."number" ] [ "f"."id" ASC, "p"."number" ASC ]
+| | | | | | ) [ "f"."id", "p"."number" ] [ "f"."id" ASC, "p"."number" NULLS 
LAST ]
 | | | | | ) [ "f"."id", "p"."number" ] [ "f"."id" ASC, "p"."number" ASC ]
 | | | | ) [ "f"."id", sys.row_number("f"."id", boolean "false" as "%17"."%17", 
sys.diff(sys.diff("f"."id" ASC), "p"."number" ASC) as "%20"."%20") as "line" ]
 | | | ) [ "f"."id" as "fid", "line" ]
diff --git a/sql/test/miscellaneous/Tests/groupby_error.stable.out 
b/sql/test/miscellaneous/Tests/groupby_error.stable.out
--- a/sql/test/miscellaneous/Tests/groupby_error.stable.out
+++ b/sql/test/miscellaneous/Tests/groupby_error.stable.out
@@ -165,7 +165,7 @@ stdout of test 'groupby_error` in direct
 % 112 # length
 group by (
 | table(sys.tab0) [ "tab0"."col0", "tab0"."col1", "tab0"."col2" ] COUNT 
-) [ "tab0"."col0", "tab0"."col1", "tab0"."col2" ] [ "tab0"."col0", 
"tab0"."col1", "tab0"."col2", "tab0"."col0" ]
+) [ "tab0"."col2", "tab0"."col0", "tab0"."col1" ] [ "tab0"."col0", 
"tab0"."col1", "tab0"."col2", "tab0"."col0" ]
 #SELECT DISTINCT col0, col1, col2, col0 FROM tab0;
 % sys.tab0,    sys.tab0,       sys.tab0,       sys.tab0 # table_name
 % col0,        col1,   col2,   col0 # name
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to