Changeset: cc0201c866dc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc0201c866dc
Modified Files:
        sql/test/mergetables/Tests/sqlsmith-exists2.sql
        sql/test/subquery/Tests/subquery6.sql
Branch: Jun2020
Log Message:

Starting the week with more breakfast bugs :S


diffs (75 lines):

diff --git a/sql/test/mergetables/Tests/sqlsmith-exists2.sql 
b/sql/test/mergetables/Tests/sqlsmith-exists2.sql
--- a/sql/test/mergetables/Tests/sqlsmith-exists2.sql
+++ b/sql/test/mergetables/Tests/sqlsmith-exists2.sql
@@ -485,4 +485,38 @@ where (((exists (
  or (false));
   -- empty
 
+select 
+ subq_0.c3 as c0, 
+ subq_0.c4 as c1, 
+ subq_0.c2 as c2, 
+ subq_0.c1 as c3, 
+ subq_0.c2 as c4
+from 
+ (select 
+ ref_0.col0 as c0, 
+ ref_0.col0 as c1, 
+ ref_0.col0 as c2, 
+ ref_0.col1 as c3, 
+ ref_0.col2 as c4
+ from 
+ tab1 as ref_0
+ where true
+ limit 48) as subq_0
+where (case when exists (
+ select 
+ subq_0.c1 as c0, 
+ ref_1.col5 as c1, 
+ ref_1.col7 as c2, 
+ ref_1.col5 as c3, 
+ subq_0.c3 as c4, 
+ subq_0.c1 as c5
+ from 
+ longtable as ref_1
+ where (true) 
+ or ((ref_1.col1 is null) 
+ and (true))) then subq_0.c1 else subq_0.c1 end
+ is not null) 
+ and (subq_0.c3 is null);
+  -- empty
+
 ROLLBACK;
diff --git a/sql/test/subquery/Tests/subquery6.sql 
b/sql/test/subquery/Tests/subquery6.sql
--- a/sql/test/subquery/Tests/subquery6.sql
+++ b/sql/test/subquery/Tests/subquery6.sql
@@ -40,7 +40,28 @@ SELECT i FROM integers i1 WHERE (SELECT 
        --error, more than one row returned by a subquery used as an expression
 
 SELECT (SELECT (SELECT SUM(col1)) IN (MAX(col2))) FROM another_t;
-       --False
+       -- False
+
+SELECT (SELECT col1) IN ('not a number') FROM another_t;
+       -- error, cannot cast string into number
+
+SELECT (SELECT (SELECT SUM(col1)) IN (MAX(col2), '12')) FROM another_t;
+       -- False
+
+SELECT 1 IN (col4, MIN(col2)) FROM another_t;
+       --error, column "another_t.col4" must appear in the GROUP BY clause or 
be used in an aggregate function
+
+SELECT CASE WHEN ColID IS NULL THEN CAST(Product_Category AS INT) ELSE 
TotalSales END FROM tbl_ProductSales;
+       -- 200
+       -- 400
+       -- 500
+       -- 100
+
+SELECT ColID FROM tbl_ProductSales WHERE CASE WHEN ColID IS NULL THEN 
CAST(Product_Category AS INT) < 0 ELSE TotalSales > 0 END;
+       -- 1
+       -- 2
+       -- 3
+       -- 4
 
 DROP TABLE tbl_ProductSales;
 DROP TABLE another_T;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to