OLD | NEW |
1 # 2010 November 02 | 1 # 2010 November 02 |
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 set M [list] | 517 set M [list] |
518 foreach {a b} $L { | 518 foreach {a b} $L { |
519 lappend M [expr ($a ? 1 : 0) + ($b ? 2 : 0)] | 519 lappend M [expr ($a ? 1 : 0) + ($b ? 2 : 0)] |
520 } | 520 } |
521 lappend r2 $M | 521 lappend r2 $M |
522 } | 522 } |
523 | 523 |
524 do_execsql_test 11.1.$tn.2 { | 524 do_execsql_test 11.1.$tn.2 { |
525 SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr | 525 SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr |
526 } $r2 | 526 } $r2 |
527 breakpoint | |
528 | 527 |
529 do_execsql_test 11.1.$tn.2 { | 528 do_execsql_test 11.1.$tn.2 { |
530 SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr | 529 SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr |
531 } $r2 | 530 } $r2 |
532 } | 531 } |
533 set sqlite_fts3_enable_parentheses 0 | 532 set sqlite_fts3_enable_parentheses 0 |
534 | 533 |
535 #--------------------------------------------------------------------------- | 534 #--------------------------------------------------------------------------- |
536 # Test the 'b' matchinfo flag | 535 # Test the 'b' matchinfo flag |
537 # | 536 # |
538 set sqlite_fts3_enable_parentheses 1 | 537 set sqlite_fts3_enable_parentheses 1 |
539 reset_db | 538 reset_db |
540 db func mit mit | 539 db func mit mit |
541 | 540 |
542 do_test 12.0 { | 541 do_test 12.0 { |
543 set cols [list] | 542 set cols [list] |
544 for {set i 0} {$i < 50} {incr i} { lappend cols "c$i" } | 543 for {set i 0} {$i < 50} {incr i} { lappend cols "c$i" } |
545 execsql "CREATE VIRTUAL TABLE tt USING fts3([join $cols ,])" | 544 execsql "CREATE VIRTUAL TABLE tt USING fts3([join $cols ,])" |
546 } {} | 545 } {} |
547 | 546 |
548 do_execsql_test 12.1 { | 547 do_execsql_test 12.1 { |
549 INSERT INTO tt (rowid, c4, c45) VALUES(1, 'abc', 'abc'); | 548 INSERT INTO tt (rowid, c4, c45) VALUES(1, 'abc', 'abc'); |
550 SELECT mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH 'abc'; | 549 SELECT mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH 'abc'; |
551 } [list [list [expr 1<<4] [expr 1<<(45-32)]]] | 550 } [list [list [expr 1<<4] [expr 1<<(45-32)]]] |
552 | 551 |
553 set sqlite_fts3_enable_parentheses 0 | 552 set sqlite_fts3_enable_parentheses 0 |
554 finish_test | 553 finish_test |
555 | |
OLD | NEW |