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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/unixexcl.test ('k') | third_party/sqlite/src/test/vacuum.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/unordered.test
diff --git a/third_party/sqlite/src/test/unordered.test b/third_party/sqlite/src/test/unordered.test
new file mode 100644
index 0000000000000000000000000000000000000000..ca4beacac220d5cf08b4984bc589ebbd23836a83
--- /dev/null
+++ b/third_party/sqlite/src/test/unordered.test
@@ -0,0 +1,65 @@
+# 2011 April 9
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+set testprefix unordered
+
+do_execsql_test 1.0 {
+ CREATE TABLE t1(a, b);
+ CREATE INDEX i1 ON t1(a);
+ INSERT INTO t1 VALUES(1, 'xxx');
+ INSERT INTO t1 SELECT a+1, b FROM t1;
+ INSERT INTO t1 SELECT a+2, b FROM t1;
+ INSERT INTO t1 SELECT a+4, b FROM t1;
+ INSERT INTO t1 SELECT a+8, b FROM t1;
+ INSERT INTO t1 SELECT a+16, b FROM t1;
+ INSERT INTO t1 SELECT a+32, b FROM t1;
+ INSERT INTO t1 SELECT a+64, b FROM t1;
+ ANALYZE;
+} {}
+
+foreach idxmode {ordered unordered} {
+ if {$idxmode == "unordered"} {
+ execsql { UPDATE sqlite_stat1 SET stat = stat || ' unordered' }
+ db close
+ sqlite3 db test.db
+ }
+ foreach {tn sql r(ordered) r(unordered)} {
+ 1 "SELECT * FROM t1 ORDER BY a"
+ {0 0 0 {SCAN TABLE t1 USING INDEX i1 (~128 rows)}}
+ {0 0 0 {SCAN TABLE t1 (~128 rows)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY}}
+ 2 "SELECT * FROM t1 WHERE a >?"
+ {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a>?) (~32 rows)}}
+ {0 0 0 {SCAN TABLE t1 (~42 rows)}}
+ 3 "SELECT * FROM t1 WHERE a = ? ORDER BY rowid"
+ {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
+ {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}
+ 0 0 0 {USE TEMP B-TREE FOR ORDER BY}}
+ 4 "SELECT max(a) FROM t1"
+ {0 0 0 {SEARCH TABLE t1 USING COVERING INDEX i1 (~1 rows)}}
+ {0 0 0 {SEARCH TABLE t1 (~1 rows)}}
+ 5 "SELECT group_concat(b) FROM t1 GROUP BY a"
+ {0 0 0 {SCAN TABLE t1 USING INDEX i1 (~128 rows)}}
+ {0 0 0 {SCAN TABLE t1 (~128 rows)} 0 0 0 {USE TEMP B-TREE FOR GROUP BY}}
+
+ 6 "SELECT * FROM t1 WHERE a = ?"
+ {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
+ {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
+ } {
+ do_eqp_test 1.$idxmode.$tn $sql $r($idxmode)
+ }
+}
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/unixexcl.test ('k') | third_party/sqlite/src/test/vacuum.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698