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

Side by Side Diff: third_party/sqlite/src/ext/fts5/test/fts5fault5.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 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
1 # 2014 June 17 1 # 2014 June 17
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #************************************************************************* 10 #*************************************************************************
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 faultsim_test_result {0 {}} 58 faultsim_test_result {0 {}}
59 } 59 }
60 60
61 do_faultsim_test 2.2 -faults oom-t* -body { 61 do_faultsim_test 2.2 -faults oom-t* -body {
62 db eval { INSERT INTO tt(tt) VALUES('integrity-check') } 62 db eval { INSERT INTO tt(tt) VALUES('integrity-check') }
63 } -test { 63 } -test {
64 faultsim_test_result {0 {}} 64 faultsim_test_result {0 {}}
65 } 65 }
66 66
67 #------------------------------------------------------------------------- 67 #-------------------------------------------------------------------------
68 # OOM while scanning an fts5vocab table. 68 # OOM while scanning fts5vocab tables.
69 # 69 #
70 reset_db 70 reset_db
71 do_test 3.0 { 71 do_test 3.0 {
72 execsql { 72 execsql {
73 CREATE VIRTUAL TABLE tt USING fts5(x); 73 CREATE VIRTUAL TABLE tt USING fts5(x);
74 CREATE VIRTUAL TABLE tv USING fts5vocab(tt, 'row'); 74 CREATE VIRTUAL TABLE tv USING fts5vocab(tt, 'row');
75
76 CREATE VIRTUAL TABLE tt2 USING fts5(x, detail=col);
77 CREATE VIRTUAL TABLE tv2 USING fts5vocab(tt2, 'col');
78
75 INSERT INTO tt(tt, rank) VALUES('pgsz', 32); 79 INSERT INTO tt(tt, rank) VALUES('pgsz', 32);
80 INSERT INTO tt2(tt2, rank) VALUES('pgsz', 32);
76 BEGIN; 81 BEGIN;
77 } 82 }
83
78 for {set i 0} {$i < 20} {incr i} { 84 for {set i 0} {$i < 20} {incr i} {
79 set str [string repeat "$i " 50] 85 set str [string repeat "$i " 50]
80 execsql { INSERT INTO tt VALUES($str) } 86 execsql { INSERT INTO tt VALUES($str) }
87 execsql { INSERT INTO tt2 VALUES($str) }
81 } 88 }
82 execsql COMMIT 89 execsql COMMIT
83 } {} 90 } {}
84 91
85 do_faultsim_test 3.1 -faults oom-t* -body { 92 do_faultsim_test 3.1 -faults oom-t* -body {
86 db eval { 93 db eval {
87 SELECT term FROM tv; 94 SELECT term FROM tv;
88 } 95 }
89 } -test { 96 } -test {
90 faultsim_test_result {0 {0 1 10 11 12 13 14 15 16 17 18 19 2 3 4 5 6 7 8 9}} 97 faultsim_test_result {0 {0 1 10 11 12 13 14 15 16 17 18 19 2 3 4 5 6 7 8 9}}
91 } 98 }
92 99
93 do_faultsim_test 3.2 -faults oom-t* -body { 100 do_faultsim_test 3.2 -faults oom-t* -body {
94 db eval { 101 db eval {
95 SELECT term FROM tv WHERE term BETWEEN '1' AND '2'; 102 SELECT term FROM tv WHERE term BETWEEN '1' AND '2';
96 } 103 }
97 } -test { 104 } -test {
98 faultsim_test_result {0 {1 10 11 12 13 14 15 16 17 18 19 2}} 105 faultsim_test_result {0 {1 10 11 12 13 14 15 16 17 18 19 2}}
99 } 106 }
100 107
108 breakpoint
109 do_execsql_test 3.3.0 {
110 SELECT * FROM tv2;
111 } {
112 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {}
113 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {}
114 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {}
115 9 x 1 {}
116 }
117 do_faultsim_test 3.3 -faults oom-t* -body {
118 db eval {
119 SELECT * FROM tv2;
120 }
121 } -test {
122 faultsim_test_result [list 0 [list \
123 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {} \
124 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {} \
125 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {} \
126 9 x 1 {}
127 ]]
128 }
129
101 130
102 131
103 finish_test 132 finish_test
104 133
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5fault4.test ('k') | third_party/sqlite/src/ext/fts5/test/fts5fault7.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698