OLD | NEW |
1 # 2007 June 20 | 1 # 2007 June 20 |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } {{one three four} {one two three}} | 102 } {{one three four} {one two three}} |
103 do_test fts2o-2.12 { | 103 do_test fts2o-2.12 { |
104 execsql { SELECT a, b, c FROM fts_t1 WHERE c MATCH 'four'; } | 104 execsql { SELECT a, b, c FROM fts_t1 WHERE c MATCH 'four'; } |
105 } {{one three four} {one four} {one four two}} | 105 } {{one three four} {one four} {one four two}} |
106 | 106 |
107 #------------------------------------------------------------------- | 107 #------------------------------------------------------------------- |
108 # Close, delete and reopen the database. The following test should | 108 # Close, delete and reopen the database. The following test should |
109 # be run on an initially empty db. | 109 # be run on an initially empty db. |
110 # | 110 # |
111 db close | 111 db close |
112 file delete -force test.db test.db-journal | 112 forcedelete test.db test.db-journal |
113 sqlite3 db test.db | 113 sqlite3 db test.db |
114 | 114 |
115 do_test fts2o-3.1 { | 115 do_test fts2o-3.1 { |
116 execsql { | 116 execsql { |
117 CREATE VIRTUAL TABLE t1 USING fts2(a, b, c); | 117 CREATE VIRTUAL TABLE t1 USING fts2(a, b, c); |
118 INSERT INTO t1(a, b, c) VALUES('one three four', 'one four', 'one two'); | 118 INSERT INTO t1(a, b, c) VALUES('one three four', 'one four', 'one two'); |
119 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; | 119 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; |
120 } | 120 } |
121 } {{one three four} {one four} {one two}} | 121 } {{one three four} {one four} {one two}} |
122 | 122 |
123 # This test was crashing at one point. | 123 # This test was crashing at one point. |
124 # | 124 # |
125 do_test fts2o-3.2 { | 125 do_test fts2o-3.2 { |
126 execsql { | 126 execsql { |
127 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; | 127 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; |
128 CREATE TABLE t3(a, b, c); | 128 CREATE TABLE t3(a, b, c); |
129 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; | 129 SELECT a, b, c FROM t1 WHERE c MATCH 'two'; |
130 } | 130 } |
131 } {{one three four} {one four} {one two} {one three four} {one four} {one two}} | 131 } {{one three four} {one four} {one two} {one three four} {one four} {one two}} |
132 | 132 |
133 #--------------------------------------------------------------------- | 133 #--------------------------------------------------------------------- |
134 # Test that it is possible to rename an fts2 table in an attached | 134 # Test that it is possible to rename an fts2 table in an attached |
135 # database. | 135 # database. |
136 # | 136 # |
137 file delete -force test2.db test2.db-journal | 137 forcedelete test2.db test2.db-journal |
138 | 138 |
139 do_test fts2o-3.1 { | 139 do_test fts2o-3.1 { |
140 execsql { | 140 execsql { |
141 ATTACH 'test2.db' AS aux; | 141 ATTACH 'test2.db' AS aux; |
142 CREATE VIRTUAL TABLE aux.t1 USING fts2(a, b, c); | 142 CREATE VIRTUAL TABLE aux.t1 USING fts2(a, b, c); |
143 INSERT INTO aux.t1(a, b, c) VALUES( | 143 INSERT INTO aux.t1(a, b, c) VALUES( |
144 'neung song sahm', 'neung see', 'neung see song' | 144 'neung song sahm', 'neung see', 'neung see song' |
145 ); | 145 ); |
146 } | 146 } |
147 } {} | 147 } {} |
(...skipping 12 matching lines...) Expand all Loading... |
160 | 160 |
161 do_test fts2o-3.2 { | 161 do_test fts2o-3.2 { |
162 execsql { SELECT a, b, c FROM t2 WHERE a MATCH 'song'; } | 162 execsql { SELECT a, b, c FROM t2 WHERE a MATCH 'song'; } |
163 } {{neung song sahm} {neung see} {neung see song}} | 163 } {{neung song sahm} {neung see} {neung see song}} |
164 | 164 |
165 do_test fts2o-3.3 { | 165 do_test fts2o-3.3 { |
166 execsql { SELECT a, b, c FROM t1 WHERE c MATCH 'two'; } | 166 execsql { SELECT a, b, c FROM t1 WHERE c MATCH 'two'; } |
167 } {{one three four} {one four} {one two}} | 167 } {{one three four} {one four} {one two}} |
168 | 168 |
169 finish_test | 169 finish_test |
OLD | NEW |