|
1 | 1 | /******************************************************************************
|
2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite
|
3 |
| -** version 3.11.0. By combining all the individual C code files into this |
| 3 | +** version 3.11.1. By combining all the individual C code files into this |
4 | 4 | ** single large file, the entire code can be compiled as a single translation
|
5 | 5 | ** unit. This allows many compilers to do optimizations that would not be
|
6 | 6 | ** possible if the files were compiled separately. Performance improvements
|
@@ -328,9 +328,9 @@ extern "C" {
|
328 | 328 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
329 | 329 | ** [sqlite_version()] and [sqlite_source_id()].
|
330 | 330 | */
|
331 |
| -#define SQLITE_VERSION "3.11.0" |
332 |
| -#define SQLITE_VERSION_NUMBER 3011000 |
333 |
| -#define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f" |
| 331 | +#define SQLITE_VERSION "3.11.1" |
| 332 | +#define SQLITE_VERSION_NUMBER 3011001 |
| 333 | +#define SQLITE_SOURCE_ID "2016-03-03 16:17:53 f047920ce16971e573bc6ec9a48b118c9de2b3a7" |
334 | 334 |
|
335 | 335 | /*
|
336 | 336 | ** CAPI3REF: Run-Time Library Version Numbers
|
@@ -176167,6 +176167,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
|
176167 | 176167 | return pRet;
|
176168 | 176168 | }
|
176169 | 176169 |
|
| 176170 | + |
176170 | 176171 | /*
|
176171 | 176172 | ** Release a reference to data record returned by an earlier call to
|
176172 | 176173 | ** fts5DataRead().
|
@@ -177623,6 +177624,10 @@ static void fts5LeafSeek(
|
177623 | 177624 | iPgidx = szLeaf;
|
177624 | 177625 | iPgidx += fts5GetVarint32(&a[iPgidx], iTermOff);
|
177625 | 177626 | iOff = iTermOff;
|
| 177627 | + if( iOff>n ){ |
| 177628 | + p->rc = FTS5_CORRUPT; |
| 177629 | + return; |
| 177630 | + } |
177626 | 177631 |
|
177627 | 177632 | while( 1 ){
|
177628 | 177633 |
|
@@ -179968,7 +179973,10 @@ static int sqlite3Fts5IndexOptimize(Fts5Index *p){
|
179968 | 179973 | if( pLvl->aSeg ){
|
179969 | 179974 | int iLvl, iSeg;
|
179970 | 179975 | int iSegOut = 0;
|
179971 |
| - for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){ |
| 179976 | + /* Iterate through all segments, from oldest to newest. Add them to |
| 179977 | + ** the new Fts5Level object so that pLvl->aSeg[0] is the oldest |
| 179978 | + ** segment in the data structure. */ |
| 179979 | + for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){ |
179972 | 179980 | for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
|
179973 | 179981 | pLvl->aSeg[iSegOut] = pStruct->aLevel[iLvl].aSeg[iSeg];
|
179974 | 179982 | iSegOut++;
|
@@ -184355,7 +184363,7 @@ static void fts5SourceIdFunc(
|
184355 | 184363 | ){
|
184356 | 184364 | assert( nArg==0 );
|
184357 | 184365 | UNUSED_PARAM2(nArg, apUnused);
|
184358 |
| - sqlite3_result_text(pCtx, "fts5: 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f", -1, SQLITE_TRANSIENT); |
| 184366 | + sqlite3_result_text(pCtx, "fts5: 2016-03-03 16:17:53 f047920ce16971e573bc6ec9a48b118c9de2b3a7", -1, SQLITE_TRANSIENT); |
184359 | 184367 | }
|
184360 | 184368 |
|
184361 | 184369 | static int fts5Init(sqlite3 *db){
|
@@ -184416,6 +184424,17 @@ static int fts5Init(sqlite3 *db){
|
184416 | 184424 | );
|
184417 | 184425 | }
|
184418 | 184426 | }
|
| 184427 | + |
| 184428 | + /* If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file |
| 184429 | + ** fts5_test_mi.c is compiled and linked into the executable. And call |
| 184430 | + ** its entry point to enable the matchinfo() demo. */ |
| 184431 | +#ifdef SQLITE_FTS5_ENABLE_TEST_MI |
| 184432 | + if( rc==SQLITE_OK ){ |
| 184433 | + extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*); |
| 184434 | + rc = sqlite3Fts5TestRegisterMatchinfo(db); |
| 184435 | + } |
| 184436 | +#endif |
| 184437 | + |
184419 | 184438 | return rc;
|
184420 | 184439 | }
|
184421 | 184440 |
|
|
0 commit comments