Changeset: 7f638af2d2d4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f638af2d2d4
Added Files:
sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.err
sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.out
Modified Files:
sql/server/rel_optimizer.c
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/merge-table-limit.Bug-6756.stable.out
Branch: default
Log Message:
Merge with Nov2019
diffs (225 lines):
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -2157,39 +2157,23 @@ rel_push_topn_down(int *changes, mvc *sq
ul = rel_project(sql->sa, ul, NULL);
ul->exps = exps_copy(sql->sa, r->exps);
/* possibly add order by column */
- if (add_r) {
- for (node *n = ((list*)r->r)->h ; n ; n =
n->next) {
- sql_exp *exp = (sql_exp*) n->data;
- if (rel_has_exp(ul, exp))
- list_append(ul->exps,
exp_copy(sql->sa, exp));
- }
- }
+ if (add_r)
+ ul->exps = list_merge(ul->exps,
exps_copy(sql->sa, r->r), NULL);
ul->r = exps_copy(sql->sa, r->r);
ul = rel_topn(sql->sa, ul, sum_limit_offset(sql,
rel->exps));
ur = rel_project(sql->sa, ur, NULL);
ur->exps = exps_copy(sql->sa, r->exps);
/* possibly add order by column */
- if (add_r) {
- for (node *n = ((list*)r->r)->h ; n ; n =
n->next) {
- sql_exp *exp = (sql_exp*) n->data;
- if (rel_has_exp(ur, exp))
- list_append(ur->exps,
exp_copy(sql->sa, exp));
- }
- }
+ if (add_r)
+ ur->exps = list_merge(ur->exps,
exps_copy(sql->sa, r->r), NULL);
ur->r = exps_copy(sql->sa, r->r);
ur = rel_topn(sql->sa, ur, sum_limit_offset(sql,
rel->exps));
u = rel_setop(sql->sa, ul, ur, op_union);
u->exps = exps_alias(sql->sa, r->exps);
set_processed(u);
/* possibly add order by column */
- if (add_r) {
- for (node *n = ((list*)r->r)->h ; n ; n =
n->next) {
- sql_exp *exp = (sql_exp*) n->data;
- if (rel_has_exp(u, exp))
- list_append(u->exps,
exp_copy(sql->sa, exp));
- }
- }
-
+ if (add_r)
+ u->exps = list_merge(u->exps,
exps_copy(sql->sa, r->r), NULL);
if (need_distinct(r)) {
set_distinct(ul);
set_distinct(ur);
@@ -8782,6 +8766,7 @@ rel_remove_union_partitions(int *changes
return rel;
if (exp_is_zero_rows(sql, rel->l, NULL)) {
sql_rel *r = rel->r;
+ rel_rename_exps(sql, rel->exps, r->exps);
rel->r = NULL;
rel_destroy(rel);
(*changes)++;
@@ -8790,6 +8775,7 @@ rel_remove_union_partitions(int *changes
}
if (exp_is_zero_rows(sql, rel->r, NULL)) {
sql_rel *l = rel->l;
+ rel_rename_exps(sql, rel->exps, l->exps);
rel->l = NULL;
rel_destroy(rel);
(*changes)++;
diff --git a/sql/test/BugTracker-2019/Tests/All
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -6,7 +6,7 @@ subselect-contradiction.Bug-6683
insert-replica-table.Bug-6684
subselect-count.Bug-6686
subselect.Bug-6688
-timestamptransformation.Bug-6695
+#timestamptransformation.Bug-6695
duplicates-not-eliminated-long-CASE-stmt.Bug-6697
subselect.Bug-6700
alter_table_set_schema.Bug-6701
diff --git a/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.err
b/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'cte-union.Bug-6755` in directory 'sql/test/BugTracker-2019`
itself:
+
+
+# 22:24:23 >
+# 22:24:23 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=38598" "--set"
"mapi_usock=/var/tmp/mtest-21682/.s.monetdb.38598" "--forcemito"
"--dbpath=/home/niels/scratch/rc-nov2019/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 22:24:23 >
+
+# builtin opt gdk_dbpath =
/home/niels/scratch/rc-nov2019/Linux-x86_64/var/monetdb5/dbfarm/demo
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_ipv6 = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 38598
+# cmdline opt mapi_usock = /var/tmp/mtest-21682/.s.monetdb.38598
+# cmdline opt gdk_dbpath =
/home/niels/scratch/rc-nov2019/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2019
+# cmdline opt embedded_c = true
+
+# 22:24:23 >
+# 22:24:23 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-21682" "--port=38598"
+# 22:24:23 >
+
+
+# 22:24:24 >
+# 22:24:24 > "Done."
+# 22:24:24 >
+
diff --git a/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.out
b/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.stable.out
@@ -0,0 +1,72 @@
+stdout of test 'cte-union.Bug-6755` in directory 'sql/test/BugTracker-2019`
itself:
+
+
+# 22:24:23 >
+# 22:24:23 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=38598" "--set"
"mapi_usock=/var/tmp/mtest-21682/.s.monetdb.38598" "--forcemito"
"--dbpath=/home/niels/scratch/rc-nov2019/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 22:24:23 >
+
+# MonetDB 5 server v11.35.0 (hg id: d2a25d02ca50+)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2019', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 15.384 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://xps13:38598/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-21682/.s.monetdb.38598
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+# 22:24:23 >
+# 22:24:23 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-21682" "--port=38598"
+# 22:24:23 >
+
+#start transaction;
+#CREATE TABLE ontime (
+# "Year" SMALLINT,
+# "Month" TINYINT,
+# "DayofMonth" TINYINT,
+# "Carrier" CHAR(2),
+# "CRSDepTime" DECIMAL(8,2),
+# "ArrDelay" DECIMAL(8,2)
+#);
+#CREATE TABLE tmp (
+# "Hour" TINYINT,
+# "PredictedArrDelay" DECIMAL(8,2) DEFAULT 0.0
+#);
+#INSERT INTO tmp ("Hour")
+#VALUES
+# (0), (1), (2), (3), (4), (5),
+# (6), (7), (8), (9), (10), (11),
+# (12), (13), (14), (15), (16), (17),
+# (18), (19), (20), (21), (22), (23);
+[ 24 ]
+#INSERT INTO ontime VALUES (2001, 9, 2, 'AA', 900.00, -6.00);
+[ 1 ]
+#ALTER TABLE "ontime" SET READ ONLY;
+#WITH t1 AS (
+# SELECT "Carrier", CAST (FLOOR("CRSDepTime"%2400/100) AS INT) AS "Hour",
+# CAST(AVG("ArrDelay") AS DECIMAL(8,2)) AS "PredictedArrDelay"
+# FROM ontime
+# WHERE "Year" = 2007 AND "Month" = 10 AND "DayofMonth" = 24
+# GROUP BY "Carrier", "Hour"
+#),
+#t2 AS (
+# SELECT t."Carrier", tmp.*
+# FROM tmp, (SELECT DISTINCT "Carrier" FROM t1) AS t
+#)
+#SELECT "Carrier", "Hour", SUM("PredictedArrDelay")
+#FROM (SELECT * FROM t1 UNION SELECT * FROM t2) AS t
+#GROUP BY "Carrier", "Hour"
+#ORDER BY "Carrier", "Hour";
+% sys.t, sys.t, sys.L24 # table_name
+% Carrier, Hour, L24 # name
+% char, int, decimal # type
+% 2, 1, 40 # length
+#rollback;
+
+# 22:24:24 >
+# 22:24:24 > "Done."
+# 22:24:24 >
+
diff --git
a/sql/test/BugTracker-2019/Tests/merge-table-limit.Bug-6756.stable.out
b/sql/test/BugTracker-2019/Tests/merge-table-limit.Bug-6756.stable.out
--- a/sql/test/BugTracker-2019/Tests/merge-table-limit.Bug-6756.stable.out
+++ b/sql/test/BugTracker-2019/Tests/merge-table-limit.Bug-6756.stable.out
@@ -58,11 +58,9 @@ stdout of test 'merge-table-limit.Bug-67
# loading sql script: 99_system.sql
# MonetDB/SQL module loaded
-Ready.
-
-# 17:09:08 >
-# 17:09:08 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-7363" "--port=39515"
-# 17:09:08 >
+# 21:58:51 >
+# 21:58:51 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-16567" "--port=32376"
+# 21:58:51 >
#START TRANSACTION;
#CREATE SCHEMA logs;
@@ -125,7 +123,7 @@ Ready.
#WHERE processed_timestamp >= '2019-09-09 01:23:58.949' AND
processed_timestamp <= '2019-09-09 17:38:58.949'
#ORDER BY timestamp
#LIMIT 2000;
-% .L2, .L4, .L6, .L10 # table_name
+% .L1, .L2, .L3, .L4 # table_name
% timestamp, logentry_no, logsource, program # name
% timestamp, bigint, clob, clob # type
% 26, 1, 0, 0 # length
@@ -134,7 +132,7 @@ Ready.
#WHERE processed_timestamp >= '2019-09-09 01:23:58.949' AND
processed_timestamp <= '2019-09-09 17:38:58.949'
#ORDER BY timestamp
#LIMIT 2000;
-% .L2, .L4, .L6 # table_name
+% .L1, .L2, .L3 # table_name
% timestamp, logentry_no, logsource # name
% timestamp, bigint, clob # type
% 26, 1, 0 # length
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list