/ Check-in [dc511e60]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test cases for fts4aux. Fix a bug affecting fts3 tables with multiple columns.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dc511e60a65232a7087e12ff40b63506cf37a634
User & Date: dan 2011-02-05 14:37:57
Context
2011-02-05
15:47
Ensure fts4aux can handle a table name in single or double quotes as a constructor argument. check-in: 929d62e4 user: dan tags: trunk
14:37
Add test cases for fts4aux. Fix a bug affecting fts3 tables with multiple columns. check-in: dc511e60 user: dan tags: trunk
2011-02-04
18:56
Change fts4aux to (additionally) report on term frequency in individual columns of an fts table. check-in: 3996f92a user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_aux.c.

   298    298             }else{            /* 2 or greater. A position. */
   299    299               pCsr->aStat[iCol+1].nOcc++;
   300    300               pCsr->aStat[0].nOcc++;
   301    301             }
   302    302             break;
   303    303   
   304    304           /* State 3. The integer just read is a column number. */
   305         -        case 3:
          305  +        default: assert( eState==3 );
   306    306             iCol = (int)v;
   307    307             if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM;
   308    308             pCsr->aStat[iCol+1].nDoc++;
   309    309             eState = 2;
   310    310             break;
   311    311         }
   312    312       }

Changes to test/fts3fault2.test.

    35     35   
    36     36   do_faultsim_test 1.2 -prep {
    37     37     faultsim_restore_and_reopen
    38     38     db eval {SELECT * FROM sqlite_master}
    39     39   } -body {
    40     40     execsql "SELECT * FROM terms"
    41     41   } -test {
    42         -  faultsim_test_result {0 {a 1 1 b 1 1 c 2 2 d 1 1 e 1 1}}
           42  +  faultsim_test_result {0 {a * 1 1 a 0 1 1 b * 1 1 b 0 1 1 c * 2 2 c 0 2 2 d * 1 1 d 0 1 1 e * 1 1 e 0 1 1}}
    43     43   }
    44     44   
    45     45   do_faultsim_test 1.3 -prep {
    46     46     faultsim_restore_and_reopen
    47     47     db eval {SELECT * FROM sqlite_master}
    48     48   } -body {
    49     49     execsql "SELECT * FROM terms WHERE term>'a' AND TERM < 'd'"
    50     50   } -test {
    51         -  faultsim_test_result {0 {b 1 1 c 2 2}}
           51  +  faultsim_test_result {0 {b * 1 1 b 0 1 1 c * 2 2 c 0 2 2}}
    52     52   }
    53     53   
    54     54   do_faultsim_test 1.4 -prep {
    55     55     faultsim_restore_and_reopen
    56     56     db eval {SELECT * FROM sqlite_master}
    57     57   } -body {
    58     58     execsql "SELECT * FROM terms WHERE term='c'"
    59     59   } -test {
    60         -  faultsim_test_result {0 {c 2 2}}
           60  +  faultsim_test_result {0 {c * 2 2 c 0 2 2}}
    61     61   }
    62     62   
           63  +do_test 2.0 {
           64  +  faultsim_delete_and_reopen
           65  +  execsql {
           66  +    CREATE VIRTUAL TABLE tx USING fts4(a, b);
           67  +    INSERT INTO tx VALUES('a b c', 'x y z');
           68  +    CREATE VIRTUAL TABLE terms2 USING fts4aux(tx);
           69  +  }
           70  +  faultsim_save_and_close
           71  +} {}
    63     72   
           73  +do_faultsim_test 2.1 -prep {
           74  +  faultsim_restore_and_reopen
           75  +  db eval {SELECT * FROM sqlite_master}
           76  +} -body {
           77  +  execsql "SELECT * FROM terms2"
           78  +} -test {
           79  +  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}}
           80  +}
    64     81   
    65     82   finish_test