| OLD | NEW |
| 1 # 2011 January 27 | 1 # 2011 January 27 |
| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 EXPLAIN QUERY PLAN SELECT * FROM terms WHERE +term='braid' | 110 EXPLAIN QUERY PLAN SELECT * FROM terms WHERE +term='braid' |
| 111 } {0 0 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:}} | 111 } {0 0 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:}} |
| 112 | 112 |
| 113 # Now show that using "term='braid'" means the virtual table returns | 113 # Now show that using "term='braid'" means the virtual table returns |
| 114 # only 1 row to SQLite, but "+term='braid'" means all 19 are returned. | 114 # only 1 row to SQLite, but "+term='braid'" means all 19 are returned. |
| 115 # | 115 # |
| 116 do_test 2.1.2.1 { | 116 do_test 2.1.2.1 { |
| 117 set cnt 0 | 117 set cnt 0 |
| 118 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND term='braid' } | 118 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND term='braid' } |
| 119 set cnt | 119 set cnt |
| 120 } {2} | 120 } {1} |
| 121 do_test 2.1.2.2 { | 121 do_test 2.1.2.2 { |
| 122 set cnt 0 | 122 set cnt 0 |
| 123 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND +term='braid' } | 123 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND +term='braid' } |
| 124 set cnt | 124 set cnt |
| 125 } {38} | 125 } {19} |
| 126 | 126 |
| 127 # Similar to the test immediately above, but using a term ("breakfast") that | 127 # Similar to the test immediately above, but using a term ("breakfast") that |
| 128 # is not featured in the dataset. | 128 # is not featured in the dataset. |
| 129 # | 129 # |
| 130 do_test 2.1.3.1 { | 130 do_test 2.1.3.1 { |
| 131 set cnt 0 | 131 set cnt 0 |
| 132 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND term='breakfast' } | 132 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND term='breakfast' } |
| 133 set cnt | 133 set cnt |
| 134 } {0} | 134 } {0} |
| 135 do_test 2.1.3.2 { | 135 do_test 2.1.3.2 { |
| 136 set cnt 0 | 136 set cnt 0 |
| 137 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND +term='breakfast' } | 137 execsql { SELECT * FROM terms_v WHERE rec('cnt', term) AND +term='breakfast' } |
| 138 set cnt | 138 set cnt |
| 139 } {38} | 139 } {19} |
| 140 | 140 |
| 141 do_execsql_test 2.1.4.1 { SELECT * FROM terms_v WHERE term='braid' } {braid 1 1} | 141 do_execsql_test 2.1.4.1 { SELECT * FROM terms_v WHERE term='braid' } {braid 1 1} |
| 142 do_execsql_test 2.1.4.2 { SELECT * FROM terms_v WHERE +term='braid'} {braid 1 1} | 142 do_execsql_test 2.1.4.2 { SELECT * FROM terms_v WHERE +term='braid'} {braid 1 1} |
| 143 do_execsql_test 2.1.4.3 { SELECT * FROM terms_v WHERE term='breakfast' } {} | 143 do_execsql_test 2.1.4.3 { SELECT * FROM terms_v WHERE term='breakfast' } {} |
| 144 do_execsql_test 2.1.4.4 { SELECT * FROM terms_v WHERE +term='breakfast' } {} | 144 do_execsql_test 2.1.4.4 { SELECT * FROM terms_v WHERE +term='breakfast' } {} |
| 145 | 145 |
| 146 do_execsql_test 2.1.4.5 { SELECT * FROM terms_v WHERE term='cba' } {} | 146 do_execsql_test 2.1.4.5 { SELECT * FROM terms_v WHERE term='cba' } {} |
| 147 do_execsql_test 2.1.4.6 { SELECT * FROM terms_v WHERE +term='cba' } {} | 147 do_execsql_test 2.1.4.6 { SELECT * FROM terms_v WHERE +term='cba' } {} |
| 148 do_execsql_test 2.1.4.7 { SELECT * FROM terms_v WHERE term='abc' } {} | 148 do_execsql_test 2.1.4.7 { SELECT * FROM terms_v WHERE term='abc' } {} |
| 149 do_execsql_test 2.1.4.8 { SELECT * FROM terms_v WHERE +term='abc' } {} | 149 do_execsql_test 2.1.4.8 { SELECT * FROM terms_v WHERE +term='abc' } {} |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 do_test 8.1 { | 512 do_test 8.1 { |
| 513 catchsql { CREATE VIRTUAL TABLE att.aux3 USING fts4aux(main, ft1) } | 513 catchsql { CREATE VIRTUAL TABLE att.aux3 USING fts4aux(main, ft1) } |
| 514 } {1 {invalid arguments to fts4aux constructor}} | 514 } {1 {invalid arguments to fts4aux constructor}} |
| 515 | 515 |
| 516 do_test 8.2 { | 516 do_test 8.2 { |
| 517 execsql {DETACH att} | 517 execsql {DETACH att} |
| 518 catchsql { SELECT * FROM aux2 } | 518 catchsql { SELECT * FROM aux2 } |
| 519 } {1 {SQL logic error or missing database}} | 519 } {1 {SQL logic error or missing database}} |
| 520 | 520 |
| 521 finish_test | 521 finish_test |
| OLD | NEW |