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

Side by Side Diff: third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu13.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
(Empty)
1 # 2015 February 16
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 #
12 # Test an RBU update that features lots of different rbu_control strings
13 # for UPDATE statements. This tests RBU's internal UPDATE statement cache.
14 #
15
16 if {![info exists testdir]} {
17 set testdir [file join [file dirname [info script]] .. .. test]
18 }
19 source $testdir/tester.tcl
20 source $testdir/lock_common.tcl
21 set ::testprefix rbu13
22
23 do_execsql_test 1.0 {
24 CREATE TABLE t1(a PRIMARY KEY, b, c, d, e, f, g, h);
25 WITH ii(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM ii WHERE i<127)
26 INSERT INTO t1 SELECT i, 0, 0, 0, 0, 0, 0, 0 FROM ii;
27 }
28
29 forcedelete rbu.db
30 do_execsql_test 1.1 {
31 ATTACH 'rbu.db' AS rbu;
32 CREATE TABLE rbu.data_t1(a, b, c, d, e, f, g, h, rbu_control);
33 }
34
35 do_test 1.2 {
36 for {set i 0} {$i<128} {incr i} {
37 set control "."
38 for {set bit 6} {$bit>=0} {incr bit -1} {
39 if { $i & (1<<$bit) } {
40 append control "x"
41 } else {
42 append control "."
43 }
44 }
45 execsql { INSERT INTO data_t1 VALUES($i, 1, 1, 1, 1, 1, 1, 1, $control) }
46 }
47 } {}
48
49 do_test 1.3 {
50 sqlite3rbu rbu test.db rbu.db
51 while 1 {
52 set rc [rbu step]
53 if {$rc!="SQLITE_OK"} break
54 }
55 rbu close
56 } {SQLITE_DONE}
57
58 do_execsql_test 1.4 {
59 SELECT count(*) FROM t1 WHERE
60 a == ( (b<<6) + (c<<5) + (d<<4) + (e<<3) + (f<<2) + (g<<1) + (h<<0) )
61 } {128}
62
63
64 finish_test
65
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu12.test ('k') | third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu14.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698