Changeset: 353a1cd81877 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=353a1cd81877
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_statement.c
        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
        sql/test/pg_regress/Tests/timestamp.stable.out
        sql/test/pg_regress/Tests/timestamptz.stable.out
Branch: default
Log Message:

merged


diffs (187 lines):

diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -1425,7 +1425,7 @@ stmt_genselect(backend *be, stmt *lops, 
                s->op2 = rops;
                s->op3 = sub;
                s->flag = cmp_filter;
-               s->nrcols = (lops->nrcols == 2) ? 2 : 1;
+               s->nrcols = lops->nrcols;
                s->nr = getDestVar(q);
                s->q = q;
                s->cand = sub;
@@ -1582,7 +1582,7 @@ stmt_uselect(backend *be, stmt *op1, stm
                s->op2 = op2;
                s->op3 = sub;
                s->flag = cmptype;
-               s->nrcols = (op1->nrcols == 2) ? 2 : 1;
+               s->nrcols = op1->nrcols;
                s->nr = getDestVar(q);
                s->q = q;
                s->cand = sub;
@@ -1811,7 +1811,6 @@ stmt_uselect2(backend *be, stmt *op1, st
        InstrPtr q = select2_join2(be, op1, op2, op3, cmp, sub, anti, 0, 
st_uselect2, reduce);
 
        if (q) {
-               int nrcols = (op1->nrcols || op2->nrcols || op3->nrcols);
                stmt *s = stmt_create(be->mvc->sa, st_uselect2);
                if (s == NULL) {
                        freeInstruction(q);
@@ -1823,7 +1822,7 @@ stmt_uselect2(backend *be, stmt *op1, st
                s->op3 = op3;
                s->op4.stval = sub;
                s->flag = cmp;
-               s->nrcols = (!nrcols)?0:(op1->nrcols == 2) ? 2 : 1;
+               s->nrcols = op1->nrcols;
                s->nr = getDestVar(q);
                s->q = q;
                s->cand = sub;
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4611,13 +4611,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;
@@ -4876,7 +4881,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;
 
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
diff --git a/sql/test/pg_regress/Tests/timestamp.stable.out 
b/sql/test/pg_regress/Tests/timestamp.stable.out
--- a/sql/test/pg_regress/Tests/timestamp.stable.out
+++ b/sql/test/pg_regress/Tests/timestamp.stable.out
@@ -74,13 +74,13 @@ stdout of test 'timestamp` in directory 
 % 1 # length
 [ 1 ]
 #SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = cast((select 
test_current_date from test_current_date) + interval '1' DAY as timestamp);
-% sys. # table_name
+% . # table_name
 % one # name
 % bigint # type
 % 1 # length
 [ 1    ]
 #SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = cast((select 
test_current_date from test_current_date) - interval '1' DAY as timestamp);
-% sys. # table_name
+% . # table_name
 % one # name
 % bigint # type
 % 1 # length
diff --git a/sql/test/pg_regress/Tests/timestamptz.stable.out 
b/sql/test/pg_regress/Tests/timestamptz.stable.out
--- a/sql/test/pg_regress/Tests/timestamptz.stable.out
+++ b/sql/test/pg_regress/Tests/timestamptz.stable.out
@@ -43,13 +43,13 @@ stdout of test 'timestamptz` in director
 % 1 # length
 [ 1 ]
 #SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = cast((select 
test_current_date from test_current_date) + interval '1' DAY as timestamp);
-% sys. # table_name
+% . # table_name
 % one # name
 % bigint # type
 % 1 # length
 [ 1    ]
 #SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = cast((select 
test_current_date from test_current_date) - interval '1' DAY as timestamp);
-% sys. # table_name
+% . # table_name
 % one # name
 % bigint # type
 % 1 # length
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to