Changeset: e32a784535f7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e32a784535f7 Added Files: sql/test/subquery/Tests/subquery5.stable.err sql/test/subquery/Tests/subquery5.stable.out Modified Files: sql/test/subquery/Tests/subquery5.sql Branch: Jun2020 Log Message:
Approved output diffs (113 lines): diff --git a/sql/test/subquery/Tests/subquery5.sql b/sql/test/subquery/Tests/subquery5.sql --- a/sql/test/subquery/Tests/subquery5.sql +++ b/sql/test/subquery/Tests/subquery5.sql @@ -9,21 +9,19 @@ SELECT (SELECT MIN(col1) GROUP BY col2) FROM another_T; --error, subquery uses ungrouped column "another_T.col2" from outer query - SELECT (SELECT MIN(col1) WHERE SUM(col2) > 1), CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) AS BIGINT) FROM another_T GROUP BY col2; - -SELECT - (SELECT MIN(col1) WHERE SUM(SUM(col2)) > 1), - CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) AS BIGINT) -FROM another_T GROUP BY col2; -- 1 1 -- 11 11 -- 111 111 -- 1111 1111 --- The crash happens because of the nested aggregates + +SELECT + (SELECT MIN(col1) WHERE SUM(SUM(col2)) > 1), + CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) AS BIGINT) +FROM another_T GROUP BY col2; --error, aggregate function calls cannot be nested SELECT CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) OVER () AS BIGINT), diff --git a/sql/test/subquery/Tests/subquery5.stable.err b/sql/test/subquery/Tests/subquery5.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/subquery/Tests/subquery5.stable.err @@ -0,0 +1,25 @@ +stderr of test 'subquery5` in directory 'sql/test/subquery` itself: + + +# 08:41:39 > +# 08:41:39 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-11456" "--port=33245" +# 08:41:39 > + +MAPI = (monetdb) /var/tmp/mtest-11456/.s.monetdb.33245 +QUERY = SELECT + (SELECT MIN(col1) GROUP BY col2) + FROM another_T; --error, subquery uses ungrouped column "another_T.col2" from outer query +ERROR = !SELECT: subquery uses ungrouped column "another_t.col2" from outer query +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-11456/.s.monetdb.33245 +QUERY = SELECT + (SELECT MIN(col1) WHERE SUM(SUM(col2)) > 1), + CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) AS BIGINT) + FROM another_T GROUP BY col2; --error, aggregate function calls cannot be nested +ERROR = !SELECT: aggregate function calls cannot be nested +CODE = 42000 + +# 08:41:39 > +# 08:41:39 > "Done." +# 08:41:39 > + diff --git a/sql/test/subquery/Tests/subquery5.stable.out b/sql/test/subquery/Tests/subquery5.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/subquery/Tests/subquery5.stable.out @@ -0,0 +1,48 @@ +stdout of test 'subquery5` in directory 'sql/test/subquery` itself: + + +# 08:41:39 > +# 08:41:39 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-11456" "--port=33245" +# 08:41:39 > + +#CREATE TABLE tbl_ProductSales (ColID int, Product_Category varchar(64), Product_Name varchar(64), TotalSales int); +#INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100); +[ 4 ] +#CREATE TABLE another_T (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 INT, col7 INT, col8 INT); +#INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), (111,222,333,444,555,666,777,888), (1111,2222,3333,4444,5555,6666,7777,8888); +[ 4 ] +#CREATE TABLE integers(i INTEGER); +#INSERT INTO integers VALUES (1), (2), (3), (NULL); +[ 4 ] +#SELECT +# (SELECT MIN(col1) WHERE SUM(col2) > 1), +# CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) AS BIGINT) +#FROM another_T GROUP BY col2; +% .%2, .%5 # table_name +% %2, %5 # name +% int, bigint # type +% 4, 4 # length +[ 1, 1 ] +[ 11, 11 ] +[ 111, 111 ] +[ 1111, 1111 ] +#SELECT +# CAST(SUM((SELECT col1 FROM tbl_ProductSales GROUP BY col2)) OVER () AS BIGINT), +# CAST(SUM((SELECT SUM(ColID) FROM tbl_ProductSales GROUP BY col2)) OVER () AS BIGINT) +#FROM another_T; +% .%11, .%22 # table_name +% %11, %22 # name +% bigint, bigint # type +% 4, 2 # length +[ 1234, 40 ] +[ 1234, 40 ] +[ 1234, 40 ] +[ 1234, 40 ] +#DROP TABLE tbl_ProductSales; +#DROP TABLE another_T; +#DROP TABLE integers; + +# 08:41:39 > +# 08:41:39 > "Done." +# 08:41:39 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list