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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2011 April 9
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
9 #
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
12 #
13
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16
17 set testprefix unordered
18
19 do_execsql_test 1.0 {
20 CREATE TABLE t1(a, b);
21 CREATE INDEX i1 ON t1(a);
22 INSERT INTO t1 VALUES(1, 'xxx');
23 INSERT INTO t1 SELECT a+1, b FROM t1;
24 INSERT INTO t1 SELECT a+2, b FROM t1;
25 INSERT INTO t1 SELECT a+4, b FROM t1;
26 INSERT INTO t1 SELECT a+8, b FROM t1;
27 INSERT INTO t1 SELECT a+16, b FROM t1;
28 INSERT INTO t1 SELECT a+32, b FROM t1;
29 INSERT INTO t1 SELECT a+64, b FROM t1;
30 ANALYZE;
31 } {}
32
33 foreach idxmode {ordered unordered} {
34 if {$idxmode == "unordered"} {
35 execsql { UPDATE sqlite_stat1 SET stat = stat || ' unordered' }
36 db close
37 sqlite3 db test.db
38 }
39 foreach {tn sql r(ordered) r(unordered)} {
40 1 "SELECT * FROM t1 ORDER BY a"
41 {0 0 0 {SCAN TABLE t1 USING INDEX i1 (~128 rows)}}
42 {0 0 0 {SCAN TABLE t1 (~128 rows)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY}}
43 2 "SELECT * FROM t1 WHERE a >?"
44 {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a>?) (~32 rows)}}
45 {0 0 0 {SCAN TABLE t1 (~42 rows)}}
46 3 "SELECT * FROM t1 WHERE a = ? ORDER BY rowid"
47 {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
48 {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}
49 0 0 0 {USE TEMP B-TREE FOR ORDER BY}}
50 4 "SELECT max(a) FROM t1"
51 {0 0 0 {SEARCH TABLE t1 USING COVERING INDEX i1 (~1 rows)}}
52 {0 0 0 {SEARCH TABLE t1 (~1 rows)}}
53 5 "SELECT group_concat(b) FROM t1 GROUP BY a"
54 {0 0 0 {SCAN TABLE t1 USING INDEX i1 (~128 rows)}}
55 {0 0 0 {SCAN TABLE t1 (~128 rows)} 0 0 0 {USE TEMP B-TREE FOR GROUP BY}}
56
57 6 "SELECT * FROM t1 WHERE a = ?"
58 {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
59 {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?) (~1 rows)}}
60 } {
61 do_eqp_test 1.$idxmode.$tn $sql $r($idxmode)
62 }
63 }
64
65 finish_test
OLDNEW
« 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