OLD | NEW |
1 # 2011 February 3 | 1 # 2011 February 3 |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 do_faultsim_test 2.1 -prep { | 76 do_faultsim_test 2.1 -prep { |
77 faultsim_restore_and_reopen | 77 faultsim_restore_and_reopen |
78 db eval {SELECT * FROM sqlite_master} | 78 db eval {SELECT * FROM sqlite_master} |
79 } -body { | 79 } -body { |
80 execsql "SELECT * FROM terms2" | 80 execsql "SELECT * FROM terms2" |
81 } -test { | 81 } -test { |
82 faultsim_test_result {0 {a * 1 1 a 0 1 1 b * 1 1 b 0 1 1 c * 1 1 c 0 1 1 x * 1
1 x 1 1 1 y * 1 1 y 1 1 1 z * 1 1 z 1 1 1}} | 82 faultsim_test_result {0 {a * 1 1 a 0 1 1 b * 1 1 b 0 1 1 c * 1 1 c 0 1 1 x * 1
1 x 1 1 1 y * 1 1 y 1 1 1 z * 1 1 z 1 1 1}} |
83 } | 83 } |
84 | 84 |
| 85 do_faultsim_test 3.0 -faults oom* -prep { |
| 86 faultsim_delete_and_reopen |
| 87 db eval { CREATE TABLE 'xx yy'(a, b); } |
| 88 } -body { |
| 89 execsql { |
| 90 CREATE VIRTUAL TABLE tt USING fts4(content="xx yy"); |
| 91 } |
| 92 } -test { |
| 93 faultsim_test_result {0 {}} |
| 94 } |
| 95 |
| 96 do_faultsim_test 3.1 -faults oom* -prep { |
| 97 faultsim_delete_and_reopen |
| 98 db func zip zip |
| 99 db func unzip unzip |
| 100 } -body { |
| 101 execsql { |
| 102 CREATE VIRTUAL TABLE tt USING fts4(compress=zip, uncompress=unzip); |
| 103 } |
| 104 } -test { |
| 105 faultsim_test_result {0 {}} |
| 106 } |
| 107 |
| 108 do_test 4.0 { |
| 109 faultsim_delete_and_reopen |
| 110 execsql { |
| 111 CREATE VIRTUAL TABLE ft USING fts4(a, b); |
| 112 INSERT INTO ft VALUES('U U T C O', 'F N D E S'); |
| 113 INSERT INTO ft VALUES('P H X G B', 'I D M R U'); |
| 114 INSERT INTO ft VALUES('P P X D M', 'Y V N T C'); |
| 115 INSERT INTO ft VALUES('Z L Q O W', 'D F U N Q'); |
| 116 INSERT INTO ft VALUES('A J D U P', 'C H M Q E'); |
| 117 INSERT INTO ft VALUES('P S A O H', 'S Z C W D'); |
| 118 INSERT INTO ft VALUES('T B N L W', 'C A K T I'); |
| 119 INSERT INTO ft VALUES('K E Z L O', 'L L Y C E'); |
| 120 INSERT INTO ft VALUES('C R E S V', 'Q V F W P'); |
| 121 INSERT INTO ft VALUES('S K H G W', 'R W Q F G'); |
| 122 } |
| 123 faultsim_save_and_close |
| 124 } {} |
| 125 do_faultsim_test 4.1 -prep { |
| 126 faultsim_restore_and_reopen |
| 127 db eval {SELECT * FROM sqlite_master} |
| 128 } -body { |
| 129 execsql { INSERT INTO ft(ft) VALUES('rebuild') } |
| 130 } -test { |
| 131 faultsim_test_result {0 {}} |
| 132 } |
| 133 |
| 134 ifcapable fts3_unicode { |
| 135 do_test 5.0 { |
| 136 faultsim_delete_and_reopen |
| 137 execsql { |
| 138 CREATE VIRTUAL TABLE ft USING fts4(a, tokenize=unicode61); |
| 139 } |
| 140 faultsim_save_and_close |
| 141 } {} |
| 142 |
| 143 do_faultsim_test 5.1 -faults oom* -prep { |
| 144 faultsim_restore_and_reopen |
| 145 db eval {SELECT * FROM sqlite_master} |
| 146 } -body { |
| 147 execsql { INSERT INTO ft VALUES('the quick brown fox'); } |
| 148 execsql { INSERT INTO ft VALUES( |
| 149 'theunusuallylongtokenthatjustdragsonandonandonandthendragsonsomemoreeof' |
| 150 ); |
| 151 } |
| 152 execsql { SELECT docid FROM ft WHERE ft MATCH 'th*' } |
| 153 } -test { |
| 154 faultsim_test_result {0 {1 2}} |
| 155 } |
| 156 } |
| 157 |
85 finish_test | 158 finish_test |
OLD | NEW |