Index: third_party/sqlite/src/test/select7.test |
diff --git a/third_party/sqlite/src/test/select7.test b/third_party/sqlite/src/test/select7.test |
index 3837c8822f1779878efbcda75e1959696183725e..e8fc4400064faa52317ac439f0dad2cd7b75df19 100644 |
--- a/third_party/sqlite/src/test/select7.test |
+++ b/third_party/sqlite/src/test/select7.test |
@@ -156,4 +156,47 @@ ifcapable compound { |
} |
} |
+# This block of tests verifies that bug aa92c76cd4 is fixed. |
+# |
+do_test select7-7.1 { |
+ execsql { |
+ CREATE TABLE t3(a REAL); |
+ INSERT INTO t3 VALUES(44.0); |
+ INSERT INTO t3 VALUES(56.0); |
+ } |
+} {} |
+do_test select7-7.2 { |
+ execsql { |
+ pragma vdbe_trace = 0; |
+ SELECT (CASE WHEN a=0 THEN 0 ELSE (a + 25) / 50 END) AS categ, count(*) |
+ FROM t3 GROUP BY categ |
+ } |
+} {1.38 1 1.62 1} |
+do_test select7-7.3 { |
+ execsql { |
+ CREATE TABLE t4(a REAL); |
+ INSERT INTO t4 VALUES( 2.0 ); |
+ INSERT INTO t4 VALUES( 3.0 ); |
+ } |
+} {} |
+do_test select7-7.4 { |
+ execsql { |
+ SELECT (CASE WHEN a=0 THEN 'zero' ELSE a/2 END) AS t FROM t4 GROUP BY t; |
+ } |
+} {1.0 1.5} |
+do_test select7-7.5 { |
+ execsql { SELECT a=0, typeof(a) FROM t4 } |
+} {0 real 0 real} |
+do_test select7-7.6 { |
+ execsql { SELECT a=0, typeof(a) FROM t4 GROUP BY a } |
+} {0 real 0 real} |
+ |
+do_test select7-7.7 { |
+ execsql { |
+ CREATE TABLE t5(a TEXT, b INT); |
+ INSERT INTO t5 VALUES(123, 456); |
+ SELECT typeof(a), a FROM t5 GROUP BY a HAVING a<b; |
+ } |
+} {text 123} |
+ |
finish_test |