1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Make sure the count(*) optimization works correctly on WITHOUT ROWID tables.

FossilOrigin-Name: 91174779786be07d63f3c4a5277602ddc5f0ba26
This commit is contained in:
drh
2013-11-12 14:55:40 +00:00
parent e3ab729a9c
commit abcc1941db
4 changed files with 18 additions and 14 deletions

View File

@@ -4670,7 +4670,7 @@ int sqlite3Select(
**
** (2011-04-15) Do not do a full scan of an unordered index.
**
** (2013-10-03) Do not count the entires in a partial index.
** (2013-10-03) Do not count the entries in a partial index.
**
** In practice the KeyInfo structure will not be used. It is only
** passed to keep OP_OpenRead happy.
@@ -4682,6 +4682,8 @@ int sqlite3Select(
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
){
pBest = pIdx;
}else if( pIdx->autoIndex==2 && pBest==0 && !HasRowid(pTab) ){
pBest = pIdx;
}
}
if( pBest ){