Changeset: 7f138b59ffd0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7f138b59ffd0
Branch: default
Log Message:
Merge with Sep2022 branch.
diffs (132 lines):
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -775,3 +775,4 @@ 470e524a786ee0e94c7901ec98d95ac351a0e472
9785fa2a471fe32495e07479edf110335ddaa750 Jan2022_17
26ffeb5af5240c807a6583fd6eb4ee2c9cd210d2 Jan2022_19
3191fee438036ac0da1e6f31481b9681399123b5 Jan2022_21
+3191fee438036ac0da1e6f31481b9681399123b5 Jan2022_SP4_release
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -838,6 +838,8 @@ SERVERlisten(int port, const char *usock
GDKfree(usockfilenew);
#endif
+ fflush(stdout);
+
return MAL_SUCCEED;
}
diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -1835,7 +1835,7 @@ rel_push_aggr_down(visitor *v, sql_rel *
node *n, *m;
list *lgbe = NULL, *rgbe = NULL, *gbe = NULL, *exps = NULL;
- if (u->op == op_project)
+ if (u->op == op_project && !need_distinct(u))
u = u->l;
if (!u || !is_union(u->op) || need_distinct(u) || is_single(u)
|| !u->exps || rel_is_ref(u))
diff --git a/sql/test/BugTracker-2022/Tests/All
b/sql/test/BugTracker-2022/Tests/All
--- a/sql/test/BugTracker-2022/Tests/All
+++ b/sql/test/BugTracker-2022/Tests/All
@@ -12,3 +12,4 @@ dump-table-data.Bug-7282
NOT_WIN32?cudf-grouped-aggr.Bug-7285
create_func_with_case_and_in
single_row_in_rel_order_by_column.Bug-7306
+push-aggr-down-removes-distinct-on-union-all.Bug-7318
diff --git
a/sql/test/BugTracker-2022/Tests/push-aggr-down-removes-distinct-on-union-all.Bug-7318.test
b/sql/test/BugTracker-2022/Tests/push-aggr-down-removes-distinct-on-union-all.Bug-7318.test
new file mode 100644
--- /dev/null
+++
b/sql/test/BugTracker-2022/Tests/push-aggr-down-removes-distinct-on-union-all.Bug-7318.test
@@ -0,0 +1,27 @@
+statement ok
+create table foo (n int, m int)
+
+statement ok
+create table bar (n int, m int)
+
+statement ok
+insert into foo values (1,1), (2,1), (1,2), (3,1)
+
+statement ok
+insert into bar values (2,2), (3,2), (1,3), (3,3)
+
+statement ok
+create view fub as
+ select * from foo
+ union all
+ select * from bar
+
+query I nosort
+select count(distinct n) from fub
+----
+3
+
+query I nosort
+select count(*) from (select distinct n from fub) as subq
+----
+3
diff --git a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
@@ -4,6 +4,7 @@ CREATE USER "testuser" WITH ENCRYPTED PA
CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
COMMENT ON SCHEMA "testschema" IS 'a schema used for testing';
ALTER USER "testuser" SET SCHEMA "testschema";
+GRANT COPY FROM TO "testuser";
CREATE SEQUENCE "testschema"."selfref_seq" AS INTEGER;
COMMENT ON SEQUENCE "testschema"."selfref_seq" IS 'sequence number for selfref
table';
CREATE SEQUENCE "testschema"."test_seq" AS INTEGER;
@@ -101438,6 +101439,8 @@ ALTER TABLE "testschema"."keytest2" ADD
ALTER TABLE "testschema"."selfref" ADD CONSTRAINT "selfref_parentid_fkey"
FOREIGN KEY ("parentid") REFERENCES "testschema"."selfref" ("id");
ALTER SEQUENCE "testschema"."selfref_seq" RESTART WITH 7 NO CYCLE;
ALTER SEQUENCE "testschema"."test_seq" RESTART WITH 8 INCREMENT BY 3 MINVALUE
5 MAXVALUE 10 CYCLE;
+GRANT SELECT("string1") ON "testschema"."smallstring" TO "testuser" WITH GRANT
OPTION;
+GRANT SELECT("string3") ON "testschema"."smallstring" TO "testuser" WITH GRANT
OPTION;
GRANT EXECUTE ON FUNCTION "testschema"."keyjoin" TO "public";
SET SCHEMA "sys";
COMMIT;
diff --git a/sql/test/testdb-upgrade/Tests/dump.stable.out
b/sql/test/testdb-upgrade/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade/Tests/dump.stable.out
@@ -4,6 +4,7 @@ CREATE USER "testuser" WITH ENCRYPTED PA
CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
COMMENT ON SCHEMA "testschema" IS 'a schema used for testing';
ALTER USER "testuser" SET SCHEMA "testschema";
+GRANT COPY FROM TO "testuser";
CREATE SEQUENCE "testschema"."selfref_seq" AS INTEGER;
COMMENT ON SEQUENCE "testschema"."selfref_seq" IS 'sequence number for selfref
table';
CREATE SEQUENCE "testschema"."test_seq" AS INTEGER;
@@ -101438,6 +101439,8 @@ ALTER TABLE "testschema"."keytest2" ADD
ALTER TABLE "testschema"."selfref" ADD CONSTRAINT "selfref_parentid_fkey"
FOREIGN KEY ("parentid") REFERENCES "testschema"."selfref" ("id");
ALTER SEQUENCE "testschema"."selfref_seq" RESTART WITH 7 NO CYCLE;
ALTER SEQUENCE "testschema"."test_seq" RESTART WITH 8 INCREMENT BY 3 MINVALUE
5 MAXVALUE 10 CYCLE;
+GRANT SELECT("string1") ON "testschema"."smallstring" TO "testuser" WITH GRANT
OPTION;
+GRANT SELECT("string3") ON "testschema"."smallstring" TO "testuser" WITH GRANT
OPTION;
GRANT EXECUTE ON FUNCTION "testschema"."keyjoin" TO "public";
SET SCHEMA "sys";
COMMIT;
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2639,13 +2639,14 @@ class ServerClass:
res = mapiportre.search(connurl)
port = res.group('port')
else:
- while True:
+ loadedseen = False
+ while port is None or not loadedseen:
line = proc.stdout.readline()
if not line:
break
self.outfile.write(line)
if 'MonetDB/SQL module loaded' in line:
- break
+ loadedseen = True
res = mapiportre.search(line)
if res is not None:
port = res.group('port')
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]