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

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

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/sqlite/src/test/delete4.test ('k') | third_party/sqlite/src/test/e_blobbytes.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/distinct.test
diff --git a/third_party/sqlite/src/test/distinct.test b/third_party/sqlite/src/test/distinct.test
index 78c2c1df363de9df1123455a22b486e3106fef92..dac2269b0bcf2321e4b28495e73b933251707c44 100644
--- a/third_party/sqlite/src/test/distinct.test
+++ b/third_party/sqlite/src/test/distinct.test
@@ -222,4 +222,51 @@ do_execsql_test 4.1 {
SELECT quote(x) FROM t2 ORDER BY 1;
} {'xyzzy' X'0000000000'}
+#----------------------------------------------------------------------------
+# Ticket [c5ea805691bfc4204b1cb9e9aa0103bd48bc7d34] (2014-12-04)
+# Make sure that DISTINCT works together with ORDER BY and descending
+# indexes.
+#
+do_execsql_test 5.1 {
+ DROP TABLE IF EXISTS t1;
+ CREATE TABLE t1(x);
+ INSERT INTO t1(x) VALUES(3),(1),(5),(2),(6),(4),(5),(1),(3);
+ CREATE INDEX t1x ON t1(x DESC);
+ SELECT DISTINCT x FROM t1 ORDER BY x ASC;
+} {1 2 3 4 5 6}
+do_execsql_test 5.2 {
+ SELECT DISTINCT x FROM t1 ORDER BY x DESC;
+} {6 5 4 3 2 1}
+do_execsql_test 5.3 {
+ SELECT DISTINCT x FROM t1 ORDER BY x;
+} {1 2 3 4 5 6}
+do_execsql_test 5.4 {
+ DROP INDEX t1x;
+ CREATE INDEX t1x ON t1(x ASC);
+ SELECT DISTINCT x FROM t1 ORDER BY x ASC;
+} {1 2 3 4 5 6}
+do_execsql_test 5.5 {
+ SELECT DISTINCT x FROM t1 ORDER BY x DESC;
+} {6 5 4 3 2 1}
+do_execsql_test 5.6 {
+ SELECT DISTINCT x FROM t1 ORDER BY x;
+} {1 2 3 4 5 6}
+
+#-------------------------------------------------------------------------
+# 2015-11-23. Problem discovered by Kostya Serebryany using libFuzzer
+#
+db close
+sqlite3 db :memory:
+do_execsql_test 6.1 {
+ CREATE TABLE jjj(x);
+ SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1)
+ FROM sqlite_master;
+} {jjj}
+do_execsql_test 6.2 {
+ CREATE TABLE nnn(x);
+ SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1)
+ FROM sqlite_master;
+} {mmm}
+
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/delete4.test ('k') | third_party/sqlite/src/test/e_blobbytes.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698