Changeset: 2d9b9d9aa58c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d9b9d9aa58c
Added Files:
        sql/test/BugTracker-2016/Tests/create_merge_table_withdata.Bug-4041.sql
        
sql/test/BugTracker-2016/Tests/create_merge_table_withdata.Bug-4041.stable.err
        
sql/test/BugTracker-2016/Tests/create_merge_table_withdata.Bug-4041.stable.out
        sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.sql
        
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
        
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/benchmarks/ssbm/Tests/01-plan.stable.out
        sql/benchmarks/ssbm/Tests/02-plan.stable.out
        sql/benchmarks/ssbm/Tests/03-plan.stable.out
        sql/benchmarks/ssbm/Tests/11-plan.stable.out
        sql/benchmarks/ssbm/Tests/12-plan.stable.out
        sql/benchmarks/ssbm/Tests/13-plan.stable.out
        sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/01-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/03-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/05-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/06-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/07-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/08-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/08-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/09-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/10-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/11-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/12-explain.stable.out
        sql/benchmarks/tpch/Tests/12-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/12-plan.stable.out
        sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/19-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/22-plan.stable.out
        sql/common/sql_types.h
        sql/include/sql_relation.h
        sql/server/rel_exp.c
        sql/server/rel_exp.h
        sql/server/rel_optimizer.c
        sql/server/rel_schema.c
        sql/server/rel_select.c
        sql/server/sql_atom.c
        sql/server/sql_atom.h
        
sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.stable.out.int128
        sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out
        
sql/test/BugTracker-2009/Tests/arithmetic-small-values-null.SF-2921310.stable.out.int128
        
sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out
        sql/test/BugTracker-2011/Tests/supertype.Bug-2830.stable.out
        sql/test/BugTracker-2012/Tests/float-mod.Bug-3086.stable.out
        sql/test/BugTracker-2012/Tests/power_priority.Bug-2291.stable.out
        sql/test/BugTracker-2012/Tests/power_priority.Bug-2291.stable.out.int128
        sql/test/BugTracker-2015/Tests/operator-priority.Bug-3686.stable.out
        sql/test/BugTracker-2016/Tests/All
        sql/test/BugTracker-2016/Tests/epoch.Bug-3979.stable.out
        
sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out
        sql/test/bugs/Tests/arith-bug-sf-949228.stable.out
        sql/test/bugs/Tests/create_insert_select_aggr-bug-00001.stable.out
        sql/test/mergetables/Tests/part-elim.sql
        sql/test/mergetables/Tests/part-elim.stable.out
Branch: default
Log Message:

Merger


diffs (truncated from 2720 to 300 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
@@ -419,6 +419,7 @@ exp_bin(mvc *sql, sql_exp *e, stmt *left
                        stmt *orderby = NULL;
                        stmt *col = NULL;
                
+                       assert(0);
                        if (exps) {
                                for (en = exps->h; en; en = en->next) {
                                        stmt *es;
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3955,6 +3955,7 @@ str_2time_daytimetz(daytime *res, const 
        else
                pos = daytime_fromstr(*v, &len, &res);
        if (!pos || pos < (int)strlen(*v))
+       if (!pos || pos < (int)strlen(*v) || ATOMcmp(TYPE_daytime, res, 
ATOMnilptr(TYPE_daytime)) == 0)
                throw(SQL, "daytime", "22007!daytime (%s) has incorrect 
format", *v);
        return daytime_2time_daytime(res, res, digits);
 }
@@ -4030,7 +4031,7 @@ str_2time_timestamptz(timestamp *res, co
                pos = timestamp_tz_fromstr(*v, &len, &res);
        else
                pos = timestamp_fromstr(*v, &len, &res);
-       if (!pos || pos < (int)strlen(*v))
+       if (!pos || pos < (int)strlen(*v) || ATOMcmp(TYPE_timestamp, res, 
ATOMnilptr(TYPE_timestamp)) == 0)
                throw(SQL, "timestamp", "22007!timestamp (%s) has incorrect 
format", *v);
        return timestamp_2time_timestamp(res, res, digits);
 }
diff --git a/sql/benchmarks/ssbm/Tests/01-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/01-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/01-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/01-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "1" <= lineorder.lo_discount <= int "3", lineorder.lo_quantity < 
int "25" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | ) [ dwdate.d_year = int "1993" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "1" <= lineorder.lo_discount <= int "3", lineorder.lo_quantity 
< int "25" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
+| | | | ) [ dwdate.d_year = int "1993" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:56 >  
diff --git a/sql/benchmarks/ssbm/Tests/02-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/02-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/02-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/02-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "4" <= lineorder.lo_discount <= int "6", int "26" <= 
lineorder.lo_quantity <= int "35" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_yearmonthnum, dwdate.%TID% NOT NULL ] 
COUNT 
-| | | ) [ dwdate.d_yearmonthnum = int "199401" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "4" <= lineorder.lo_discount <= int "6", int "26" <= 
lineorder.lo_quantity <= int "35" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_yearmonthnum, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ dwdate.d_yearmonthnum = int "199401" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:56 >  
diff --git a/sql/benchmarks/ssbm/Tests/03-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/03-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/03-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/03-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "5" <= lineorder.lo_discount <= int "7", int "36" <= 
lineorder.lo_quantity <= int "40" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.d_weeknuminyear, 
dwdate.%TID% NOT NULL ] COUNT 
-| | | ) [ dwdate.d_year = int "1994", dwdate.d_weeknuminyear = int "6" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "5" <= lineorder.lo_discount <= int "7", int "36" <= 
lineorder.lo_quantity <= int "40" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.d_weeknuminyear, 
dwdate.%TID% NOT NULL ] COUNT 
+| | | | ) [ dwdate.d_year = int "1994", dwdate.d_weeknuminyear = int "6" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:57 >  
diff --git a/sql/benchmarks/ssbm/Tests/11-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/11-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/11-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/11-plan.stable.out
@@ -40,29 +40,31 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.part) [ part.p_mfgr, part.%TID% NOT NULL ] COUNT 
+| | | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
+| | | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.part) [ part.p_mfgr, part.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
-| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | | table(sys.supplier) [ supplier.s_region, supplier.%TID% NOT NULL 
] COUNT 
+| | | | | | ) [ supplier.s_region = clob "AMERICA" ]
+| | | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.supplier) [ supplier.s_region, supplier.%TID% NOT NULL ] 
COUNT 
-| | | | | ) [ supplier.s_region = clob "AMERICA" ]
-| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | | select (
-| | | | | table(sys.customer) [ customer.c_nation, customer.c_region, 
customer.%TID% NOT NULL ] COUNT 
-| | | | ) [ customer.c_region = clob "AMERICA" ]
-| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ],
-| | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [ dwdate.d_year, customer.c_nation ] [ dwdate.d_year, customer.c_nation, 
sys.sum no nil (sys.sql_sub(bigint[lineorder.lo_revenue] as 
lineorder.lo_revenue, bigint[lineorder.lo_supplycost] as 
lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | | table(sys.customer) [ customer.c_nation, customer.c_region, 
customer.%TID% NOT NULL ] COUNT 
+| | | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ],
+| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ dwdate.d_year, customer.c_nation, lineorder.lo_revenue, 
lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as L2.L2, 
bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as L4.L4 ]
+| ) [ dwdate.d_year, customer.c_nation ] [ dwdate.d_year, customer.c_nation, 
sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, customer.c_nation, L1 as L1.profit1 ] [ dwdate.d_year ASC, 
customer.c_nation ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/ssbm/Tests/12-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/12-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/12-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/12-plan.stable.out
@@ -41,31 +41,33 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
+| | | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
-| | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
+| | | | | | | table(sys.part) [ part.p_mfgr, part.p_category, part.%TID% NOT 
NULL ] COUNT 
+| | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
+| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.part) [ part.p_mfgr, part.p_category, part.%TID% NOT 
NULL ] COUNT 
-| | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
-| | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | table(sys.supplier) [ supplier.s_nation, supplier.s_region, 
supplier.%TID% NOT NULL ] COUNT 
+| | | | | ) [ supplier.s_region = clob "AMERICA" ]
+| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | select (
-| | | | | table(sys.supplier) [ supplier.s_nation, supplier.s_region, 
supplier.%TID% NOT NULL ] COUNT 
-| | | | ) [ supplier.s_region = clob "AMERICA" ]
-| | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | select (
-| | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
-| | | ) [ customer.c_region = clob "AMERICA" ]
-| | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
-| ) [ dwdate.d_year, supplier.s_nation, part.p_category ] [ dwdate.d_year, 
supplier.s_nation, part.p_category, sys.sum no nil 
(sys.sql_sub(bigint[lineorder.lo_revenue] as lineorder.lo_revenue, 
bigint[lineorder.lo_supplycost] as lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
+| | ) [ dwdate.d_year, supplier.s_nation, part.p_category, 
lineorder.lo_revenue, lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as 
L2.L2, bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as 
L4.L4 ]
+| ) [ dwdate.d_year, supplier.s_nation, part.p_category ] [ dwdate.d_year, 
supplier.s_nation, part.p_category, sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, supplier.s_nation, part.p_category, L1 as L1.profit1 ] [ 
dwdate.d_year ASC, supplier.s_nation ASC, part.p_category ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/ssbm/Tests/13-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/13-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/13-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/13-plan.stable.out
@@ -41,31 +41,33 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
+| | | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
-| | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
+| | | | | | | table(sys.part) [ part.p_category, part.p_brand1, part.%TID% NOT 
NULL ] COUNT 
+| | | | | | ) [ part.p_category = clob "MFGR#14" ]
+| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.part) [ part.p_category, part.p_brand1, part.%TID% NOT 
NULL ] COUNT 
-| | | | | ) [ part.p_category = clob "MFGR#14" ]
-| | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | table(sys.supplier) [ supplier.s_city, supplier.s_nation, 
supplier.%TID% NOT NULL ] COUNT 
+| | | | | ) [ supplier.s_nation = clob "UNITED STATES" ]
+| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | select (
-| | | | | table(sys.supplier) [ supplier.s_city, supplier.s_nation, 
supplier.%TID% NOT NULL ] COUNT 
-| | | | ) [ supplier.s_nation = clob "UNITED STATES" ]
-| | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | select (
-| | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
-| | | ) [ customer.c_region = clob "AMERICA" ]
-| | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
-| ) [ dwdate.d_year, supplier.s_city, part.p_brand1 ] [ dwdate.d_year, 
supplier.s_city, part.p_brand1, sys.sum no nil 
(sys.sql_sub(bigint[lineorder.lo_revenue] as lineorder.lo_revenue, 
bigint[lineorder.lo_supplycost] as lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
+| | ) [ dwdate.d_year, supplier.s_city, part.p_brand1, lineorder.lo_revenue, 
lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as L2.L2, 
bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as L4.L4 ]
+| ) [ dwdate.d_year, supplier.s_city, part.p_brand1 ] [ dwdate.d_year, 
supplier.s_city, part.p_brand1, sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, supplier.s_city, part.p_brand1, L1 as L1.profit1 ] [ 
dwdate.d_year ASC, supplier.s_city ASC, part.p_brand1 ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128 
b/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
@@ -52,72 +52,72 @@ Ready.
 % clob # type
 % 607 # length
 function user.s2_1(A0:bte,A1:bte,A2:bte,A3:date,A4:lng):void;
-    X_226:void := querylog.define("explain select\n l_returnflag,\n 
l_linestatus,\n sum(l_quantity) as sum_qty,\n sum(l_extendedprice) as 
sum_base_price,\n sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,\n 
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,\n 
avg(l_quantity) as avg_qty,\n avg(l_extendedprice) as avg_price,\n 
avg(l_discount) as avg_disc,\n count(*) as count_order\nfrom\n 
lineitem\nwhere\n l_shipdate <= date \\'1998-12-01\\' - interval \\'90\\' day 
(3)\ngroup by\n l_returnflag,\n l_linestatus\norder by\n l_returnflag,\n 
l_linestatus;","sequential_pipe",129);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to