Changeset: f335b5b56aca for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f335b5b56aca
Added Files:
sql/test/BugTracker-2019/Tests/subselect.Bug-6688.sql
sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.err
sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.out
Modified Files:
buildtools/doc/windowsbuild.rst
gdk/gdk_calc.c
sql/test/BugTracker-2019/Tests/All
testing/Mtest.py.in
Branch: subquery
Log Message:
merged
diffs (truncated from 586 to 300 lines):
diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -691,13 +691,12 @@ Studio Tools`` -> ``Visual Studio x64 Wi
(this is for a 64-bit build on a 64-bit version of the operating
system).
-When using the Intel compiler, you also need to set the ``CC`` and
-``CXX`` variables::
+When using the Intel compiler, you also need to set the ``CC``
+variable::
set CC=icl -Qstd=c99 -GR- -Qsafeseh-
- set CXX=icl -Qstd=c99 -GR- -Qsafeseh-
-(These are the values for the 10.1 and 11.1 versions, for 9.1 replace
+(This is the value for the 10.1 and 11.1 versions, for 9.1 replace
``-Qstd=c99`` with ``-Qc99``.)
Internal Variables
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -259,7 +259,7 @@ BATcalcnot(BAT *b, BAT *s)
bn->trevsorted = nils == 0 && b->tsorted;
bn->tnil = nils != 0;
bn->tnonil = nils == 0;
- bn->tkey = b->tkey;
+ bn->tkey = b->tkey && nils <= 1;
if (nils != 0 && !b->tnil) {
b->tnil = true;
@@ -378,7 +378,7 @@ BATcalcnegate(BAT *b, BAT *s)
bn->trevsorted = nils == 0 && b->tsorted;
bn->tnil = nils != 0;
bn->tnonil = nils == 0;
- bn->tkey = b->tkey;
+ bn->tkey = b->tkey && nils <= 1;
if (nils != 0 && !b->tnil) {
b->tnil = true;
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
@@ -5,3 +5,4 @@ date_trunc_bulk
subselect-contradiction.Bug-6683
insert-replica-table.Bug-6684
subselect-count.Bug-6686
+subselect.Bug-6688
diff --git a/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.sql
b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.sql
@@ -0,0 +1,131 @@
+START TRANSACTION;
+
+CREATE TABLE "sys"."unitTestDontDelete" (
+ "A" VARCHAR(255),
+ "B" BIGINT,
+ "C" DOUBLE,
+ "D" TIMESTAMP
+);
+INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10
11:10:10.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11
12:11:11.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12
13:12:12.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13
14:13:13.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14
15:14:14.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15
16:15:15.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16
17:16:16.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17
18:17:17.000000');
+INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18
19:18:18.000000');
+
+with "cp_t" as
+(
+ select
+ "cn_t"."A",
+ "cn_t"."B",
+ "cn_t"."C",
+ "cn_t"."D"
+ from
+ "unitTestDontDelete" as "cn_t"
+ where
+ (
+ "B" is null
+ or "B" <> 8
+ )
+)
+select
+ (
+ select
+ coalesce(sum("B"), 0)
+ from
+ "cp_t" as "cr_t"
+ where
+ (
+ "cr_t"."C" >=
+ (
+ select
+ coalesce(MEDIAN("B"),0)
+ from
+ "cp_t" as "cq_t"
+ where
+ (
+ "cq_t"."A" = "cp_t"."A"
+ or
+ (
+ "cq_t"."A" is null
+ and "cp_t"."A" is null
+ )
+ )
+ )
+ )
+ )
+ as "co_f1"
+from
+ "cp_t";
+
+with "cp_t" as
+(
+ select
+ "cn_t"."A",
+ "cn_t"."B",
+ "cn_t"."C",
+ "cn_t"."D"
+ from
+ "unitTestDontDelete" as "cn_t"
+ where
+ (
+ "B" is null
+ or "B" <> 8
+ )
+)
+select
+ (
+ select
+ coalesce(sum("B"), 0)
+ from
+ "cp_t" as "cr_t"
+ where
+ (
+ "cr_t"."C" >=
+ (
+ select
+ coalesce(MEDIAN("B"),0)
+ from
+ "cp_t" as "cq_t"
+ where
+ (
+ "cq_t"."A" = "cp_t"."A"
+ or
+ (
+ "cq_t"."A" is null
+ and "cp_t"."A" is null
+ )
+ )
+ )
+ or
+ (
+ "cr_t"."C" is null
+ and
+ (
+ select
+ coalesce(MEDIAN("B"),0)
+ from
+ "cp_t" as "cq_t"
+ where
+ (
+ "cq_t"."A" = "cp_t"."A"
+ or
+ (
+ "cq_t"."A" is null
+ and "cp_t"."A" is null
+ )
+ )
+ )
+ is null
+ )
+ )
+ )
+ as "co_f1"
+from
+ "cp_t";
+
+ROLLBACK;
diff --git a/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.err
b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'subselect.Bug-6688` in directory 'sql/test/BugTracker-2019`
itself:
+
+
+# 15:15:23 >
+# 15:15:23 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=30281" "--set"
"mapi_usock=/var/tmp/mtest-10238/.s.monetdb.30281" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/home/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 15:15:23 >
+
+# builtin opt gdk_dbpath = /home/sjoerd/@Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt gdk_debug = 0
+# builtin opt gdk_vmtrim = no
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = 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 = 30281
+# cmdline opt mapi_usock = /var/tmp/mtest-10238/.s.monetdb.30281
+# cmdline opt monet_prompt =
+# cmdline opt gdk_dbpath =
/home/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019
+# cmdline opt embedded_c = true
+# cmdline opt gdk_debug = 553648138
+
+# 15:15:24 >
+# 15:15:24 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-10238" "--port=30281"
+# 15:15:24 >
+
+
+# 15:15:24 >
+# 15:15:24 > "Done."
+# 15:15:24 >
+
diff --git a/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.out
b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/subselect.Bug-6688.stable.out
@@ -0,0 +1,193 @@
+stdout of test 'subselect.Bug-6688` in directory 'sql/test/BugTracker-2019`
itself:
+
+
+# 15:15:23 >
+# 15:15:23 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=30281" "--set"
"mapi_usock=/var/tmp/mtest-10238/.s.monetdb.30281" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/home/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019"
"--set" "embedded_c=true"
+# 15:15:23 >
+
+# MonetDB 5 server v11.31.14 (hg id: a540ef19db1b)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2019', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 15.511 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://meeuw.mullender.nl:30281/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-10238/.s.monetdb.30281
+# MonetDB/GIS module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 18_index.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_views.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 40_json_hge.sql
+# loading sql script: 41_md5sum.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 46_profiler.sql
+# loading sql script: 51_sys_schema_extension.sql
+# loading sql script: 60_wlcr.sql
+# loading sql script: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_lidar.sql
+# loading sql script: 75_shp.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 85_bam.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 15:15:24 >
+# 15:15:24 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-10238" "--port=30281"
+# 15:15:24 >
+
+#START TRANSACTION;
+#CREATE TABLE "sys"."unitTestDontDelete" (
+# "A" VARCHAR(255),
+# "B" BIGINT,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list