1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix errors in the table resize detection.

FossilOrigin-Name: 4229caec0b60a1617b9d5ff94b47271cbd7be1e0
This commit is contained in:
drh
2017-02-18 02:42:54 +00:00
parent 182e84c116
commit dfe11bae99
4 changed files with 15 additions and 13 deletions

View File

@@ -5331,8 +5331,8 @@ i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
assert( cursorOwnsBtShared(pCur) );
assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
if( pCur->eState!=CURSOR_VALID ) return -1;
if( pCur->apPage[pCur->iPage-1]->leaf==0 ) return -1;
for(n=1, i=0; i<pCur->iPage; i++){
if( pCur->apPage[pCur->iPage]->leaf==0 ) return -1;
for(n=1, i=0; i<=pCur->iPage; i++){
n *= pCur->apPage[i]->nCell;
}
return n;