1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Always reinitialized the Index.bUnordered and Index.noSkipscan flags before

rereading the sqlite_stat1 table, even if SQLITE_ENABLE_STAT4 is defined.

FossilOrigin-Name: 1e1221fc4823a6bb6fc5d2408732e27aca585de9
This commit is contained in:
drh
2014-11-22 21:37:00 +00:00
parent ab4624d005
commit 0da10d3289
3 changed files with 25 additions and 24 deletions

View File

@@ -1438,8 +1438,6 @@ static void decodeIntArray(
if( z==0 ) z = "";
#else
assert( z!=0 );
pIndex->bUnordered = 0;
pIndex->noSkipScan = 0;
#endif
for(i=0; *z && i<nOut; i++){
v = 0;
@@ -1459,25 +1457,28 @@ static void decodeIntArray(
if( *z==' ' ) z++;
}
#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
assert( pIndex!=0 );
assert( pIndex!=0 ); {
#else
if( pIndex )
if( pIndex ){
#endif
while( z[0] ){
if( sqlite3_strglob("unordered*", z)==0 ){
pIndex->bUnordered = 1;
}else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){
pIndex->szIdxRow = sqlite3LogEst(sqlite3Atoi(z+3));
}else if( sqlite3_strglob("noskipscan*", z)==0 ){
pIndex->noSkipScan = 1;
}
pIndex->bUnordered = 0;
pIndex->noSkipScan = 0;
while( z[0] ){
if( sqlite3_strglob("unordered*", z)==0 ){
pIndex->bUnordered = 1;
}else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){
pIndex->szIdxRow = sqlite3LogEst(sqlite3Atoi(z+3));
}else if( sqlite3_strglob("noskipscan*", z)==0 ){
pIndex->noSkipScan = 1;
}
#ifdef SQLITE_ENABLE_COSTMULT
else if( sqlite3_strglob("costmult=[0-9]*",z)==0 ){
pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
}
else if( sqlite3_strglob("costmult=[0-9]*",z)==0 ){
pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
}
#endif
while( z[0]!=0 && z[0]!=' ' ) z++;
while( z[0]==' ' ) z++;
while( z[0]!=0 && z[0]!=' ' ) z++;
while( z[0]==' ' ) z++;
}
}
}