Changeset: b8c955e61def for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8c955e61def
Added Files:
        sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.sql
        sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.err
        sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.out
Modified Files:
        sql/test/BugTracker-2016/Tests/All
Branch: Jun2016
Log Message:

Add test script for bug 6119


diffs (268 lines):

diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -58,5 +58,6 @@ dce.Bug-6114
 dce2.Bug-6115
 semijoin.Bug-6116
 split_project.Bug-6117
+case-column-when-null-Bug-6124
+select-in-from.Bug-6119
 select-in-from.Bug-6121
-case-column-when-null-Bug-6124
diff --git a/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.sql 
b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.sql
@@ -0,0 +1,77 @@
+START TRANSACTION;
+
+CREATE TABLE places(
+    id BIGINT NOT NULL PRIMARY KEY,
+    name VARCHAR(200) NOT NULL,
+    url VARCHAR(2000) NOT NULL,
+    "type" VARCHAR(40) NOT NULL, 
+    isPartOf BIGINT
+);
+
+CREATE TABLE friends(
+    src BIGINT NOT NULL,
+    dst BIGINT NOT NULL,
+    creationDate TIMESTAMP(3) WITH TIME ZONE NOT NULL,
+    PRIMARY KEY(src, dst)
+);
+
+CREATE TABLE persons(
+    id BIGINT NOT NULL PRIMARY KEY,
+    firstName VARCHAR(40) NOT NULL ,
+    lastName VARCHAR(40) NOT NULL,
+    gender VARCHAR(40) NOT NULL,
+    birthDay DATE NOT NULL,
+    creationDate TIMESTAMP(3) WITH TIME ZONE NOT NULL,
+    locationIP VARCHAR(40) NOT NULL,
+    browserUsed VARCHAR(40) NOT NULL,
+    place_id BIGINT NOT NULL
+);
+
+ALTER TABLE friends ADD FOREIGN KEY(src) REFERENCES persons(id);
+ALTER TABLE friends ADD FOREIGN KEY(dst) REFERENCES persons(id);
+ALTER TABLE places ADD FOREIGN KEY(isPartOf) REFERENCES places(id);
+ALTER TABLE persons ADD FOREIGN KEY(place_id) REFERENCES places(id);
+
+WITH
+params AS (
+  SELECT id, countryX, countryY, startDate, startDate + CAST (duration AS 
INTERVAL DAY) AS endDate FROM (
+    SELECT
+      4398046512167 AS id,
+      'United_Kingdom' AS countryX,
+      'United_States' AS countryY,
+      CAST('2011-11-05' AS TIMESTAMP(3)) AS startDate,
+      365 AS duration
+  ) AS tmp
+),
+countries AS (
+    SELECT id FROM places WHERE type = 'country' AND name = (SELECT countryX 
from params)
+  UNION
+    SELECT id FROM places WHERE type = 'country' AND name = (SELECT countryY 
from params)
+),
+friends_id1 AS (
+  SELECT f.dst AS id FROM friends f WHERE f.src = (SELECT id FROM params)
+),
+friends_id2 AS (
+    SELECT f.dst AS id FROM friends f WHERE f.src IN (SELECT id FROM 
friends_id1) AND f.dst <> (SELECT id FROM params)
+   UNION
+    SELECT * FROM friends_id1
+),
+candidates AS (
+    SELECT p.id
+    FROM friends_id2 f, persons p, places city, places country
+    WHERE
+      f.id = p.id AND p.place_id = city.id AND city.ispartof NOT IN (SELECT * 
FROM countries)
+)
+SELECT * FROM candidates;
+
+ROLLBACK;
+
+-- comment 4 reproduction example
+START TRANSACTION;
+CREATE TABLE subt (A1 BIGINT);
+CREATE TABLE t (B BIGINT);
+
+SELECT (B IN (SELECT A1 FROM subt)) FROM t;
+
+ROLLBACK;
+
diff --git a/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.err 
b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.err
@@ -0,0 +1,36 @@
+stderr of test 'select-in-from.Bug-6119` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 18:05:23 >  
+# 18:05:23 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37227" "--set" 
"mapi_usock=/var/tmp/mtest-21010/.s.monetdb.37227" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2016"
 "--set" "embedded_r=yes"
+# 18:05:23 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/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 = 37227
+# cmdline opt  mapi_usock = /var/tmp/mtest-21010/.s.monetdb.37227
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2016
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 18:05:23 >  
+# 18:05:23 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21010" "--port=37227"
+# 18:05:23 >  
+
+
+
+# 18:05:24 >  
+# 18:05:24 >  "Done."
+# 18:05:24 >  
+
diff --git a/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.out 
b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/select-in-from.Bug-6119.stable.out
@@ -0,0 +1,129 @@
+stdout of test 'select-in-from.Bug-6119` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 18:05:23 >  
+# 18:05:23 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=37227" "--set" 
"mapi_usock=/var/tmp/mtest-21010/.s.monetdb.37227" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch2/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2016"
 "--set" "embedded_r=yes"
+# 18:05:23 >  
+
+# MonetDB 5 server v11.23.14
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2016', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
+# Found 15.589 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2016 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://toulouse.da.cwi.nl:37227/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-21010/.s.monetdb.37227
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+# MonetDB/R   module loaded
+
+Ready.
+# 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: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.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_gsl.sql
+# loading sql script: 46_profiler.sql
+# loading sql script: 51_sys_schema_extension.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
+
+# 18:05:23 >  
+# 18:05:23 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-21010" "--port=37227"
+# 18:05:23 >  
+
+#START TRANSACTION;
+#CREATE TABLE places(
+#    id BIGINT NOT NULL PRIMARY KEY,
+#    name VARCHAR(200) NOT NULL,
+#    url VARCHAR(2000) NOT NULL,
+#    "type" VARCHAR(40) NOT NULL, 
+#    isPartOf BIGINT
+#);
+#CREATE TABLE friends(
+#    src BIGINT NOT NULL,
+#    dst BIGINT NOT NULL,
+#    creationDate TIMESTAMP(3) WITH TIME ZONE NOT NULL,
+#    PRIMARY KEY(src, dst)
+#);
+#CREATE TABLE persons(
+#    id BIGINT NOT NULL PRIMARY KEY,
+#    firstName VARCHAR(40) NOT NULL ,
+#    lastName VARCHAR(40) NOT NULL,
+#    gender VARCHAR(40) NOT NULL,
+#    birthDay DATE NOT NULL,
+#    creationDate TIMESTAMP(3) WITH TIME ZONE NOT NULL,
+#    locationIP VARCHAR(40) NOT NULL,
+#    browserUsed VARCHAR(40) NOT NULL,
+#    place_id BIGINT NOT NULL
+#);
+#ALTER TABLE friends ADD FOREIGN KEY(src) REFERENCES persons(id);
+#ALTER TABLE friends ADD FOREIGN KEY(dst) REFERENCES persons(id);
+#ALTER TABLE places ADD FOREIGN KEY(isPartOf) REFERENCES places(id);
+#ALTER TABLE persons ADD FOREIGN KEY(place_id) REFERENCES places(id);
+#WITH
+#params AS (
+#  SELECT id, countryX, countryY, startDate, startDate + CAST (duration AS 
INTERVAL DAY) AS endDate FROM (
+#    SELECT
+#      4398046512167 AS id,
+#      'United_Kingdom' AS countryX,
+#      'United_States' AS countryY,
+#      CAST('2011-11-05' AS TIMESTAMP(3)) AS startDate,
+#      365 AS duration
+#  ) AS tmp
+#),
+#countries AS (
+#    SELECT id FROM places WHERE type = 'country' AND name = (SELECT countryX 
from params)
+#  UNION
+#    SELECT id FROM places WHERE type = 'country' AND name = (SELECT countryY 
from params)
+% sys.candidates # table_name
+% id # name
+% bigint # type
+% 1 # length
+#ROLLBACK;
+#CREATE TABLE subt (A1 BIGINT);
+#CREATE TABLE t (B BIGINT);
+#SELECT (B IN (SELECT A1 FROM subt)) FROM t;
+% .L1 # table_name
+% L1 # name
+% boolean # type
+% 5 # length
+#ROLLBACK;
+
+# 18:05:24 >  
+# 18:05:24 >  "Done."
+# 18:05:24 >  
+
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to