summaryrefslogtreecommitdiff
path: root/test/distinct.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
committerHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
commit9f67c0520ea0d5f11a190197cdf746c512db4ce4 (patch)
treec88a33f01f20a3d13a09594f114fffacebd0d1a4 /test/distinct.test
parentee20336e9c78d2e3782c8d096b9ab4f6ca8ce95f (diff)
parent569c6676a6ddb0ff73821d7693b5e18ddef809b9 (diff)
Merge tag 'upstream/3.2.0'
Upstream version 3.2.0 # gpg: Signature made Thu 16 Oct 2014 10:51:39 PM EDT using RSA key ID 374BBE81 # gpg: Good signature from "Hans-Christoph Steiner <hans@guardianproject.info>" # gpg: aka "Hans-Christoph Steiner <hans@eds.org>" # gpg: aka "Hans-Christoph Steiner <hans@at.or.at>" # gpg: aka "[jpeg image of size 5408]"
Diffstat (limited to 'test/distinct.test')
-rw-r--r--test/distinct.test29
1 files changed, 27 insertions, 2 deletions
diff --git a/test/distinct.test b/test/distinct.test
index fcbe4e6..78c2c1d 100644
--- a/test/distinct.test
+++ b/test/distinct.test
@@ -162,10 +162,10 @@ do_execsql_test 2.0 {
foreach {tn sql temptables res} {
1 "a, b FROM t1" {} {A B a b}
2 "b, a FROM t1" {} {B A b a}
- 3 "a, b, c FROM t1" {hash} {a b c A B C}
+ 3 "a, b, c FROM t1" {hash} {A B C a b c}
4 "a, b, c FROM t1 ORDER BY a, b, c" {btree} {A B C a b c}
5 "b FROM t1 WHERE a = 'a'" {} {b}
- 6 "b FROM t1" {hash} {b B}
+ 6 "b FROM t1 ORDER BY +b COLLATE binary" {btree hash} {B b}
7 "a FROM t1" {} {A a}
8 "b COLLATE nocase FROM t1" {} {b}
9 "b COLLATE nocase FROM t1 ORDER BY b COLLATE nocase" {} {b}
@@ -197,4 +197,29 @@ do_test 3.1 {
}]
} {0}
+#-------------------------------------------------------------------------
+# Ticket [fccbde530a6583bf2748400919f1603d5425995c] (2014-01-08)
+# The logic that computes DISTINCT sometimes thinks that a zeroblob()
+# and a blob of all zeros are different when they should be the same.
+#
+do_execsql_test 4.1 {
+ DROP TABLE IF EXISTS t1;
+ DROP TABLE IF EXISTS t2;
+ CREATE TABLE t1(a INTEGER);
+ INSERT INTO t1 VALUES(3);
+ INSERT INTO t1 VALUES(2);
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ INSERT INTO t1 VALUES(3);
+ INSERT INTO t1 VALUES(1);
+ CREATE TABLE t2(x);
+ INSERT INTO t2
+ SELECT DISTINCT
+ CASE a WHEN 1 THEN x'0000000000'
+ WHEN 2 THEN zeroblob(5)
+ ELSE 'xyzzy' END
+ FROM t1;
+ SELECT quote(x) FROM t2 ORDER BY 1;
+} {'xyzzy' X'0000000000'}
+
finish_test