Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: third_party/sqlite/src/test/collate1.test

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/src/test/collate1.test
diff --git a/third_party/sqlite/src/test/collate1.test b/third_party/sqlite/src/test/collate1.test
index ac2c75be388acaa3fc602a4c643bf05b9622eda8..20854157d3a1d9ee0a7a4971883445993b4ef7dd 100644
--- a/third_party/sqlite/src/test/collate1.test
+++ b/third_party/sqlite/src/test/collate1.test
@@ -304,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

Powered by Google App Engine
This is Rietveld 408576698