Changeset: b18d9db66ec1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b18d9db66ec1
Modified Files:
sql/server/rel_select.c
Branch: default
Log Message:
Merge with Jan2022 branch.
diffs (166 lines):
diff --git a/sql/benchmarks/nobench/Tests/data
b/sql/benchmarks/nobench/Tests/data
deleted file mode 100644
--- a/sql/benchmarks/nobench/Tests/data
+++ /dev/null
@@ -1,10 +0,0 @@
-{"nested_obj": {"num": 4, "str": "GBRDCMBQ"}, "dyn2": true, "dyn1": 9,
"nested_arr": ["especially"], "str2": "GBRDCMBQ", "str1": "GBRDCMBQGE======",
"sparse_093": "GBRDCMBQGE======", "thousandth": 9, "sparse_090":
"GBRDCMBQGE======", "sparse_091": "GBRDCMBQGE======", "sparse_092":
"GBRDCMBQGE======", "num": 9, "bool": true, "sparse_095": "GBRDCMBQGE======",
"sparse_096": "GBRDCMBQGE======", "sparse_097": "GBRDCMBQGE======",
"sparse_098": "GBRDCMBQGE======", "sparse_094": "GBRDCMBQGE======",
"sparse_099": "GBRDCMBQGE======"}
-{"nested_obj": {"num": 2, "str": "GBRDCMA="}, "dyn2": "GBRDCMJR", "dyn1": 7,
"nested_arr": ["its", "for", "if", "he", "questions", "to", "put"], "str2":
"GBRDCMA=", "str1": "GBRDCMJR", "sparse_079": "GBRDCMJR", "thousandth": 7,
"sparse_078": "GBRDCMJR", "num": 7, "bool": true, "sparse_072": "GBRDCMJR",
"sparse_073": "GBRDCMJR", "sparse_070": "GBRDCMJR", "sparse_071": "GBRDCMJR",
"sparse_076": "GBRDCMJR", "sparse_077": "GBRDCMJR", "sparse_074": "GBRDCMJR",
"sparse_075": "GBRDCMJR"}
-{"nested_obj": {"num": 3, "str": "GBRDCMI="}, "dyn2": 8, "dyn1": 8,
"nested_arr": [], "str2": "GBRDCMI=", "str1": "GBRDCMBQGA======", "thousandth":
8, "sparse_087": "GBRDCMBQGA======", "sparse_086": "GBRDCMBQGA======",
"sparse_085": "GBRDCMBQGA======", "num": 8, "bool": false, "sparse_082":
"GBRDCMBQGA======", "sparse_081": "GBRDCMBQGA======", "sparse_080":
"GBRDCMBQGA======", "sparse_083": "GBRDCMBQGA======", "sparse_084":
"GBRDCMBQGA======", "sparse_089": "GBRDCMBQGA======", "sparse_088":
"GBRDCMBQGA======"}
-{"nested_obj": {"num": 0, "str": "GBRDA==="}, "dyn2": 5, "dyn1": 5,
"nested_arr": ["the", "state", "aware", "''", "the"], "str2": "GBRDA===",
"str1": "GBRDCMBR", "sparse_058": "GBRDCMBR", "thousandth": 5, "num": 5,
"bool": true, "sparse_059": "GBRDCMBR", "sparse_054": "GBRDCMBR", "sparse_055":
"GBRDCMBR", "sparse_056": "GBRDCMBR", "sparse_057": "GBRDCMBR", "sparse_050":
"GBRDCMBR", "sparse_051": "GBRDCMBR", "sparse_052": "GBRDCMBR", "sparse_053":
"GBRDCMBR"}
-{"nested_obj": {"num": 8, "str": "GBRDCMBQGA======"}, "sparse_035":
"GBRDCMI=", "dyn2": true, "dyn1": 3, "nested_arr": ["check", "it", "the"],
"str2": "GBRDCMBQGA======", "str1": "GBRDCMI=", "thousandth": 3, "sparse_036":
"GBRDCMI=", "sparse_037": "GBRDCMI=", "sparse_034": "GBRDCMI=", "num": 3,
"bool": true, "sparse_033": "GBRDCMI=", "sparse_030": "GBRDCMI=", "sparse_031":
"GBRDCMI=", "sparse_032": "GBRDCMI=", "sparse_038": "GBRDCMI=", "sparse_039":
"GBRDCMI="}
-{"nested_obj": {"num": 9, "str": "GBRDCMBQGE======"}, "sparse_040":
"GBRDCMBQ", "dyn2": "GBRDCMBQ", "dyn1": 4, "nested_arr": ["potatoes", "a",
"to", "authentic"], "str2": "GBRDCMBQGE======", "str1": "GBRDCMBQ",
"thousandth": 4, "sparse_043": "GBRDCMBQ", "sparse_042": "GBRDCMBQ",
"sparse_041": "GBRDCMBQ", "num": 4, "bool": false, "sparse_046": "GBRDCMBQ",
"sparse_045": "GBRDCMBQ", "sparse_044": "GBRDCMBQ", "sparse_047": "GBRDCMBQ",
"sparse_049": "GBRDCMBQ", "sparse_048": "GBRDCMBQ"}
-{"sparse_018": "GBRDC===", "nested_obj": {"num": 6, "str": "GBRDCMJQ"},
"dyn2": "GBRDC===", "dyn1": 1, "nested_arr": ["button-down"], "sparse_010":
"GBRDC===", "str2": "GBRDCMJQ", "str1": "GBRDC===", "sparse_013": "GBRDC===",
"sparse_014": "GBRDC===", "sparse_015": "GBRDC===", "sparse_016": "GBRDC===",
"sparse_017": "GBRDC===", "num": 1, "bool": true, "sparse_011": "GBRDC===",
"thousandth": 1, "sparse_019": "GBRDC===", "sparse_012": "GBRDC==="}
-{"nested_obj": {"num": 7, "str": "GBRDCMJR"}, "dyn2": 2, "dyn1": 2,
"nested_arr": ["she", "beyond"], "str2": "GBRDCMJR", "str1": "GBRDCMA=",
"thousandth": 2, "sparse_025": "GBRDCMA=", "sparse_024": "GBRDCMA=",
"sparse_027": "GBRDCMA=", "num": 2, "bool": false, "sparse_020": "GBRDCMA=",
"sparse_023": "GBRDCMA=", "sparse_022": "GBRDCMA=", "sparse_021": "GBRDCMA=",
"sparse_029": "GBRDCMA=", "sparse_028": "GBRDCMA=", "sparse_026": "GBRDCMA="}
-{"nested_obj": {"num": 5, "str": "GBRDCMBR"}, "sparse_008": "GBRDA===",
"sparse_009": "GBRDA===", "dyn2": false, "dyn1": "GBRDA===", "nested_arr": [],
"sparse_007": "GBRDA===", "str2": "GBRDCMBR", "str1": "GBRDA===", "sparse_004":
"GBRDA===", "sparse_003": "GBRDA===", "sparse_002": "GBRDA===", "sparse_001":
"GBRDA===", "sparse_000": "GBRDA===", "num": 0, "bool": false, "sparse_006":
"GBRDA===", "thousandth": 0, "sparse_005": "GBRDA==="}
-{"nested_obj": {"num": 1, "str": "GBRDC==="}, "dyn2": false, "dyn1": 6,
"nested_arr": ["to", "interrupted", "some", "daily", "has", "averages"],
"str2": "GBRDC===", "str1": "GBRDCMJQ", "thousandth": 6, "sparse_069":
"GBRDCMJQ", "sparse_068": "GBRDCMJQ", "num": 6, "bool": false, "sparse_061":
"GBRDCMJQ", "sparse_060": "GBRDCMJQ", "sparse_063": "GBRDCMJQ", "sparse_062":
"GBRDCMJQ", "sparse_065": "GBRDCMJQ", "sparse_064": "GBRDCMJQ", "sparse_067":
"GBRDCMJQ", "sparse_066": "GBRDCMJQ"}
diff --git a/sql/benchmarks/nobench/Tests/nobench.test.in
b/sql/benchmarks/nobench/Tests/nobench.test
rename from sql/benchmarks/nobench/Tests/nobench.test.in
rename to sql/benchmarks/nobench/Tests/nobench.test
--- a/sql/benchmarks/nobench/Tests/nobench.test.in
+++ b/sql/benchmarks/nobench/Tests/nobench.test
@@ -2,7 +2,18 @@ statement ok
create table bench10(js json)
statement ok
-copy 10 records into bench10 from E'$QTSTSRCDIR/data'
+copy 10 records into bench10 from STDIN
+<COPY_INTO_DATA>
+{"nested_obj": {"num": 4, "str": "GBRDCMBQ"}, "dyn2": true, "dyn1": 9,
"nested_arr": ["especially"], "str2": "GBRDCMBQ", "str1": "GBRDCMBQGE======",
"sparse_093": "GBRDCMBQGE======", "thousandth": 9, "sparse_090":
"GBRDCMBQGE======", "sparse_091": "GBRDCMBQGE======", "sparse_092":
"GBRDCMBQGE======", "num": 9, "bool": true, "sparse_095": "GBRDCMBQGE======",
"sparse_096": "GBRDCMBQGE======", "sparse_097": "GBRDCMBQGE======",
"sparse_098": "GBRDCMBQGE======", "sparse_094": "GBRDCMBQGE======",
"sparse_099": "GBRDCMBQGE======"}
+{"nested_obj": {"num": 2, "str": "GBRDCMA="}, "dyn2": "GBRDCMJR", "dyn1": 7,
"nested_arr": ["its", "for", "if", "he", "questions", "to", "put"], "str2":
"GBRDCMA=", "str1": "GBRDCMJR", "sparse_079": "GBRDCMJR", "thousandth": 7,
"sparse_078": "GBRDCMJR", "num": 7, "bool": true, "sparse_072": "GBRDCMJR",
"sparse_073": "GBRDCMJR", "sparse_070": "GBRDCMJR", "sparse_071": "GBRDCMJR",
"sparse_076": "GBRDCMJR", "sparse_077": "GBRDCMJR", "sparse_074": "GBRDCMJR",
"sparse_075": "GBRDCMJR"}
+{"nested_obj": {"num": 3, "str": "GBRDCMI="}, "dyn2": 8, "dyn1": 8,
"nested_arr": [], "str2": "GBRDCMI=", "str1": "GBRDCMBQGA======", "thousandth":
8, "sparse_087": "GBRDCMBQGA======", "sparse_086": "GBRDCMBQGA======",
"sparse_085": "GBRDCMBQGA======", "num": 8, "bool": false, "sparse_082":
"GBRDCMBQGA======", "sparse_081": "GBRDCMBQGA======", "sparse_080":
"GBRDCMBQGA======", "sparse_083": "GBRDCMBQGA======", "sparse_084":
"GBRDCMBQGA======", "sparse_089": "GBRDCMBQGA======", "sparse_088":
"GBRDCMBQGA======"}
+{"nested_obj": {"num": 0, "str": "GBRDA==="}, "dyn2": 5, "dyn1": 5,
"nested_arr": ["the", "state", "aware", "''", "the"], "str2": "GBRDA===",
"str1": "GBRDCMBR", "sparse_058": "GBRDCMBR", "thousandth": 5, "num": 5,
"bool": true, "sparse_059": "GBRDCMBR", "sparse_054": "GBRDCMBR", "sparse_055":
"GBRDCMBR", "sparse_056": "GBRDCMBR", "sparse_057": "GBRDCMBR", "sparse_050":
"GBRDCMBR", "sparse_051": "GBRDCMBR", "sparse_052": "GBRDCMBR", "sparse_053":
"GBRDCMBR"}
+{"nested_obj": {"num": 8, "str": "GBRDCMBQGA======"}, "sparse_035":
"GBRDCMI=", "dyn2": true, "dyn1": 3, "nested_arr": ["check", "it", "the"],
"str2": "GBRDCMBQGA======", "str1": "GBRDCMI=", "thousandth": 3, "sparse_036":
"GBRDCMI=", "sparse_037": "GBRDCMI=", "sparse_034": "GBRDCMI=", "num": 3,
"bool": true, "sparse_033": "GBRDCMI=", "sparse_030": "GBRDCMI=", "sparse_031":
"GBRDCMI=", "sparse_032": "GBRDCMI=", "sparse_038": "GBRDCMI=", "sparse_039":
"GBRDCMI="}
+{"nested_obj": {"num": 9, "str": "GBRDCMBQGE======"}, "sparse_040":
"GBRDCMBQ", "dyn2": "GBRDCMBQ", "dyn1": 4, "nested_arr": ["potatoes", "a",
"to", "authentic"], "str2": "GBRDCMBQGE======", "str1": "GBRDCMBQ",
"thousandth": 4, "sparse_043": "GBRDCMBQ", "sparse_042": "GBRDCMBQ",
"sparse_041": "GBRDCMBQ", "num": 4, "bool": false, "sparse_046": "GBRDCMBQ",
"sparse_045": "GBRDCMBQ", "sparse_044": "GBRDCMBQ", "sparse_047": "GBRDCMBQ",
"sparse_049": "GBRDCMBQ", "sparse_048": "GBRDCMBQ"}
+{"sparse_018": "GBRDC===", "nested_obj": {"num": 6, "str": "GBRDCMJQ"},
"dyn2": "GBRDC===", "dyn1": 1, "nested_arr": ["button-down"], "sparse_010":
"GBRDC===", "str2": "GBRDCMJQ", "str1": "GBRDC===", "sparse_013": "GBRDC===",
"sparse_014": "GBRDC===", "sparse_015": "GBRDC===", "sparse_016": "GBRDC===",
"sparse_017": "GBRDC===", "num": 1, "bool": true, "sparse_011": "GBRDC===",
"thousandth": 1, "sparse_019": "GBRDC===", "sparse_012": "GBRDC==="}
+{"nested_obj": {"num": 7, "str": "GBRDCMJR"}, "dyn2": 2, "dyn1": 2,
"nested_arr": ["she", "beyond"], "str2": "GBRDCMJR", "str1": "GBRDCMA=",
"thousandth": 2, "sparse_025": "GBRDCMA=", "sparse_024": "GBRDCMA=",
"sparse_027": "GBRDCMA=", "num": 2, "bool": false, "sparse_020": "GBRDCMA=",
"sparse_023": "GBRDCMA=", "sparse_022": "GBRDCMA=", "sparse_021": "GBRDCMA=",
"sparse_029": "GBRDCMA=", "sparse_028": "GBRDCMA=", "sparse_026": "GBRDCMA="}
+{"nested_obj": {"num": 5, "str": "GBRDCMBR"}, "sparse_008": "GBRDA===",
"sparse_009": "GBRDA===", "dyn2": false, "dyn1": "GBRDA===", "nested_arr": [],
"sparse_007": "GBRDA===", "str2": "GBRDCMBR", "str1": "GBRDA===", "sparse_004":
"GBRDA===", "sparse_003": "GBRDA===", "sparse_002": "GBRDA===", "sparse_001":
"GBRDA===", "sparse_000": "GBRDA===", "num": 0, "bool": false, "sparse_006":
"GBRDA===", "thousandth": 0, "sparse_005": "GBRDA==="}
+{"nested_obj": {"num": 1, "str": "GBRDC==="}, "dyn2": false, "dyn1": 6,
"nested_arr": ["to", "interrupted", "some", "daily", "has", "averages"],
"str2": "GBRDC===", "str1": "GBRDCMJQ", "thousandth": 6, "sparse_069":
"GBRDCMJQ", "sparse_068": "GBRDCMJQ", "num": 6, "bool": false, "sparse_061":
"GBRDCMJQ", "sparse_060": "GBRDCMJQ", "sparse_063": "GBRDCMJQ", "sparse_062":
"GBRDCMJQ", "sparse_065": "GBRDCMJQ", "sparse_064": "GBRDCMJQ", "sparse_067":
"GBRDCMJQ", "sparse_066": "GBRDCMJQ"}
query I rowsort
select count(*) from bench10
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5110,7 +5110,7 @@ rel_value_exp2(sql_query *query, sql_rel
if (rel && *rel && (*rel)->card == CARD_AGGR) { /* group by expression
case, handle it before */
sql_exp *exp = NULL;
- if (!is_sql_aggr(f))
+ if (!is_sql_aggr(f) && !is_sql_window(f))
exp = frame_get_groupby_expression(sql, se);
if (sql->errstr[0] != '\0')
return NULL;
diff --git
a/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_not_in_select.Bug-6290.test
b/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_not_in_select.Bug-6290.test
---
a/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_not_in_select.Bug-6290.test
+++
b/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_not_in_select.Bug-6290.test
@@ -1,8 +1,17 @@
+statement ok
+START TRANSACTION
+
+statement ok
+CREATE TABLE "myschemas" ("id" INTEGER, "name" VARCHAR(1024), "authorization"
INTEGER, "owner" INTEGER, "system" BOOLEAN)
+
+statement ok rowcount 7
+INSERT INTO "myschemas" VALUES (2000, 'sys', 2, 3, true),(2114, 'tmp', 2, 3,
true),(7446, 'json', 3, 3, true),(7542, 'profiler', 3, 3, true),(7738, 'wlc',
3, 3, true),(7757, 'wlr', 3, 3, true),(8270, 'logging', 3, 3, true)
+
query TIII rowsort
SELECT s.name AS schema_nm, s.system AS is_system_schema
, (SELECT CAST(COUNT(*) as int) FROM sys.functions f WHERE f.schema_id = s.id
AND f.type <> 2 AND f.id NOT IN (SELECT sf.id as function_id FROM sys.functions
sf WHERE sf.system)) AS "user defined functions count"
, (SELECT CAST(COUNT(*) as int) FROM sys.functions f WHERE f.schema_id = s.id
AND f.type = 2 AND f.id NOT IN (SELECT sf.id as function_id FROM sys.functions
sf WHERE sf.system)) AS "user defined procedures count"
- FROM sys.schemas AS s
+ FROM sys.myschemas AS s
WHERE s.name IN ('json', 'profiler', 'sys')
----
json
@@ -22,7 +31,7 @@ query TIII rowsort
SELECT s.name AS schema_nm, s.system AS is_system_schema
, (SELECT CAST(COUNT(*) as int) FROM sys.functions f WHERE f.schema_id = s.id
AND f.type <> 2 AND NOT f.system) AS "user defined functions count"
, (SELECT CAST(COUNT(*) as int) FROM sys.functions f WHERE f.schema_id = s.id
AND f.type = 2 AND NOT f.system) AS "user defined procedures count"
- FROM sys.schemas AS s
+ FROM sys.myschemas AS s
WHERE s.name IN ('json', 'profiler', 'sys')
----
json
@@ -38,3 +47,27 @@ 1
0
0
+query I rowsort
+SELECT (SELECT 1 FROM functions f WHERE f.schema_id = s.id AND f.id IN (SELECT
-1 FROM functions x)) FROM myschemas AS s
+----
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+
+query I rowsort
+SELECT (SELECT 1 FROM functions f WHERE f.schema_id = s.id AND f.id NOT IN
(SELECT x.id FROM functions x)) FROM myschemas AS s
+----
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+
+statement ok
+ROLLBACK
diff --git a/sql/test/subquery/Tests/subquery3.test
b/sql/test/subquery/Tests/subquery3.test
--- a/sql/test/subquery/Tests/subquery3.test
+++ b/sql/test/subquery/Tests/subquery3.test
@@ -179,6 +179,26 @@ 2.500
2.500
2.500
+query I nosort
+SELECT
+ (SELECT RANK() OVER (PARTITION BY 2 ORDER BY 2) FROM tbl_ProductSales
GROUP BY t1.col1)
+FROM another_T t1
+----
+1
+1
+1
+1
+
+query I nosort
+SELECT
+ (SELECT SUM(1) OVER (PARTITION BY 2 ORDER BY 2 ROWS UNBOUNDED PRECEDING)
FROM tbl_ProductSales GROUP BY t1.col1)
+FROM another_T t1
+----
+1
+1
+1
+1
+
query R nosort
SELECT
(SELECT SUM(AVG(ColID + col1)) OVER (PARTITION BY SUM(ColID + col3) ORDER
BY MAX(ColID) * col4 ROWS UNBOUNDED PRECEDING) FROM tbl_ProductSales GROUP BY
t1.col1)
diff --git a/sql/test/sysmon/timeout/Tests/timeout_select.maltest
b/sql/test/sysmon/timeout/Tests/timeout_select.maltest
--- a/sql/test/sysmon/timeout/Tests/timeout_select.maltest
+++ b/sql/test/sysmon/timeout/Tests/timeout_select.maltest
@@ -19,18 +19,17 @@ dbgmsk_unset := 8+8388608;
dbgmsk_keep := calc.xor(INT_MAX,dbgmsk_unset);
dbgmsk_set := calc.and(dbgmsk_restore,dbgmsk_keep);
mdb.setDebug(dbgmsk_set);
-t1:= alarm.usec();
barrier i:= 0:int;
r:= user.random(100);
bat.append(a, r);
redo i:= iterator.next(1:int,count:int);
exit i;
mdb.setDebug(dbgmsk_restore);
-t2:= alarm.usec();
-d:=t2-t1;
-qto:= d + 1000:int;
+qto:= 1000:lng;
clients.setQryTimeoutMicro(qto);
X:bat[:oid] := algebra.select(a, 1, count, true:bit, true:bit, false:bit,
true:bit);
+qto:= 0:lng;
+clients.setQryTimeoutMicro(qto);
statement ok
factories.shutdown("user","random")
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list