summaryrefslogtreecommitdiff
path: root/test/collate1.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:35 -0400
committerHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:35 -0400
commit569c6676a6ddb0ff73821d7693b5e18ddef809b9 (patch)
tree833538da7bba39105daff45e265aef386a200acd /test/collate1.test
parent08119c361d1181b3e8f1abb429236e488a664753 (diff)
Imported Upstream version 3.2.0upstream
Diffstat (limited to 'test/collate1.test')
-rw-r--r--test/collate1.test30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/collate1.test b/test/collate1.test
index b493ee8..2085415 100644
--- a/test/collate1.test
+++ b/test/collate1.test
@@ -75,7 +75,6 @@ do_test collate1-1.1 {
}
} {{} 0x119 0x2D}
do_test collate1-1.2 {
-breakpoint
execsql {
SELECT c2 FROM collate1t1 ORDER BY 1 COLLATE hex;
}
@@ -305,4 +304,33 @@ do_test collate1-4.5 {
}
} {}
+# A problem reported on the mailing list: A CREATE TABLE statement
+# is allowed to have two or more COLLATE clauses on the same column.
+# That probably ought to be an error, but we allow it for backwards
+# compatibility. Just make sure it works and doesn't leak memory.
+#
+do_test collate1-5.1 {
+ execsql {
+ CREATE TABLE c5(
+ id INTEGER PRIMARY KEY,
+ a TEXT COLLATE binary COLLATE nocase COLLATE rtrim,
+ b TEXT COLLATE nocase COLLATE binary,
+ c TEXT COLLATE rtrim COLLATE binary COLLATE rtrim COLLATE nocase
+ );
+ INSERT INTO c5 VALUES(1, 'abc','abc','abc');
+ INSERT INTO c5 VALUES(2, 'abc ','ABC','ABC');
+ SELECT id FROM c5 WHERE a='abc' ORDER BY id;
+ }
+} {1 2}
+do_test collate1-5.2 {
+ execsql {
+ SELECT id FROM c5 WHERE b='abc' ORDER BY id;
+ }
+} {1}
+do_test collate1-5.3 {
+ execsql {
+ SELECT id FROM c5 WHERE c='abc' ORDER BY id;
+ }
+} {1 2}
+
finish_test