OLD | NEW |
1 /* fts2 has a design flaw which can lead to database corruption (see | 1 /* fts2 has a design flaw which can lead to database corruption (see |
2 ** below). It is recommended not to use it any longer, instead use | 2 ** below). It is recommended not to use it any longer, instead use |
3 ** fts3 (or higher). If you believe that your use of fts2 is safe, | 3 ** fts3 (or higher). If you believe that your use of fts2 is safe, |
4 ** add -DSQLITE_ENABLE_BROKEN_FTS2=1 to your CFLAGS. | 4 ** add -DSQLITE_ENABLE_BROKEN_FTS2=1 to your CFLAGS. |
5 */ | 5 */ |
6 #if (!defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2)) \ | 6 #if (!defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2)) \ |
7 && !defined(SQLITE_ENABLE_BROKEN_FTS2) | 7 && !defined(SQLITE_ENABLE_BROKEN_FTS2) |
8 #error fts2 has a design flaw and has been deprecated. | 8 #error fts2 has a design flaw and has been deprecated. |
9 #endif | 9 #endif |
10 /* The flaw is that fts2 uses the content table's unaliased rowid as | 10 /* The flaw is that fts2 uses the content table's unaliased rowid as |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 */ | 365 */ |
366 /* TODO(shess) The snippet-generation code should be using the | 366 /* TODO(shess) The snippet-generation code should be using the |
367 ** tokenizer-generated tokens rather than doing its own local | 367 ** tokenizer-generated tokens rather than doing its own local |
368 ** tokenization. | 368 ** tokenization. |
369 */ | 369 */ |
370 /* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */ | 370 /* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */ |
371 static int safe_isspace(char c){ | 371 static int safe_isspace(char c){ |
372 return (c&0x80)==0 ? isspace(c) : 0; | 372 return (c&0x80)==0 ? isspace(c) : 0; |
373 } | 373 } |
374 static int safe_tolower(char c){ | 374 static int safe_tolower(char c){ |
375 return (c&0x80)==0 ? tolower(c) : c; | 375 return (c>='A' && c<='Z') ? (c-'A'+'a') : c; |
376 } | 376 } |
377 static int safe_isalnum(char c){ | 377 static int safe_isalnum(char c){ |
378 return (c&0x80)==0 ? isalnum(c) : 0; | 378 return (c&0x80)==0 ? isalnum(c) : 0; |
379 } | 379 } |
380 | 380 |
381 typedef enum DocListType { | 381 typedef enum DocListType { |
382 DL_DOCIDS, /* docids only */ | 382 DL_DOCIDS, /* docids only */ |
383 DL_POSITIONS, /* docids + positions */ | 383 DL_POSITIONS, /* docids + positions */ |
384 DL_POSITIONS_OFFSETS /* docids + positions + offsets */ | 384 DL_POSITIONS_OFFSETS /* docids + positions + offsets */ |
385 } DocListType; | 385 } DocListType; |
(...skipping 6609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6995 sqlite3 *db, | 6995 sqlite3 *db, |
6996 char **pzErrMsg, | 6996 char **pzErrMsg, |
6997 const sqlite3_api_routines *pApi | 6997 const sqlite3_api_routines *pApi |
6998 ){ | 6998 ){ |
6999 SQLITE_EXTENSION_INIT2(pApi) | 6999 SQLITE_EXTENSION_INIT2(pApi) |
7000 return sqlite3Fts2Init(db); | 7000 return sqlite3Fts2Init(db); |
7001 } | 7001 } |
7002 #endif | 7002 #endif |
7003 | 7003 |
7004 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ | 7004 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ |
OLD | NEW |