1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add tests to cover untested branches in recent fts5 changes.

FossilOrigin-Name: fa0033edf6ddf3c6631fa95b343225dbc8ac9429
This commit is contained in:
dan
2016-03-10 15:12:47 +00:00
parent ecdf20d3a4
commit 1bb85f3ed3
7 changed files with 81 additions and 18 deletions

View File

@ -4553,11 +4553,10 @@ int sqlite3Fts5IndexOptimize(Fts5Index *p){
}
fts5StructureRelease(pStruct);
if( pNew && pNew->nSegment>0 ){
assert( pNew==0 || pNew->nSegment>0 );
if( pNew ){
int iLvl;
for(iLvl=0; iLvl<pNew->nLevel; iLvl++){
if( pNew->aLevel[iLvl].nSeg ) break;
}
for(iLvl=0; pNew->aLevel[iLvl].nSeg==0; iLvl++){}
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){
int nRem = FTS5_OPT_WORK_UNIT;
fts5IndexMergeLevel(p, &pNew, iLvl, &nRem);