/ Check-in [ed28c48a]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Add fault-injection tests that use the unicode61 tokenizer. Fix a problem revealed by the same.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts4-unicode
Files: files | file ages | folders
SHA1: ed28c48a3dd7e766e60db0d96ef5460bf9913e6b
User & Date: dan 2012-05-26 15:44:08
Context
2012-05-26
16:22
Add coverage tests for fts3_unicode.c. check-in: 07d3ea8a user: dan tags: fts4-unicode
15:44
Add fault-injection tests that use the unicode61 tokenizer. Fix a problem revealed by the same. check-in: ed28c48a user: dan tags: fts4-unicode
14:54
Change the name of the "unicode" tokenizer to "unicode61" to emphasize that the case folding and separator-character identification routines are based on unicode version 6.1. check-in: 8f3e60aa user: dan tags: fts4-unicode
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_write.c.

3170
3171
3172
3173
3174
3175
3176
3177





3178
3179
3180
3181
3182
3183
3184
  if( sqlite3_step(pStmt)==SQLITE_ROW ){
    fts3DecodeIntArray(nStat, a,
         sqlite3_column_blob(pStmt, 0),
         sqlite3_column_bytes(pStmt, 0));
  }else{
    memset(a, 0, sizeof(u32)*(nStat) );
  }
  sqlite3_reset(pStmt);





  if( nChng<0 && a[0]<(u32)(-nChng) ){
    a[0] = 0;
  }else{
    a[0] += nChng;
  }
  for(i=0; i<p->nColumn+1; i++){
    u32 x = a[i+1];







|
>
>
>
>
>







3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
  if( sqlite3_step(pStmt)==SQLITE_ROW ){
    fts3DecodeIntArray(nStat, a,
         sqlite3_column_blob(pStmt, 0),
         sqlite3_column_bytes(pStmt, 0));
  }else{
    memset(a, 0, sizeof(u32)*(nStat) );
  }
  rc = sqlite3_reset(pStmt);
  if( rc!=SQLITE_OK ){
    sqlite3_free(a);
    *pRC = rc;
    return;
  }
  if( nChng<0 && a[0]<(u32)(-nChng) ){
    a[0] = 0;
  }else{
    a[0] += nChng;
  }
  for(i=0; i<p->nColumn+1; i++){
    u32 x = a[i+1];

Changes to test/fts3fault2.test.

126
127
128
129
130
131
132
133






















134
  faultsim_restore_and_reopen
  db eval {SELECT * FROM sqlite_master}
} -body {
  execsql { INSERT INTO ft(ft) VALUES('rebuild') }
} -test {
  faultsim_test_result {0 {}}
}























finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
  faultsim_restore_and_reopen
  db eval {SELECT * FROM sqlite_master}
} -body {
  execsql { INSERT INTO ft(ft) VALUES('rebuild') }
} -test {
  faultsim_test_result {0 {}}
}

do_test 5.0 {
  faultsim_delete_and_reopen
  execsql {
    CREATE VIRTUAL TABLE ft USING fts4(a, tokenize=unicode61);
  }
  faultsim_save_and_close
} {}

do_faultsim_test 5.1 -faults oom* -prep {
  faultsim_restore_and_reopen
  db eval {SELECT * FROM sqlite_master}
} -body {
  execsql { INSERT INTO ft VALUES('the quick brown fox'); }
  execsql { INSERT INTO ft VALUES(
      'theunusuallylongtokenthatjustdragsonandonandonandthendragsonsomemoreeof'
    );
  }
  execsql { SELECT docid FROM ft WHERE ft MATCH 'th*' }
} -test {
  faultsim_test_result {0 {1 2}}
}

finish_test