mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
A better (simpler) fix to the count(*) problem addressed in the previous
check-in. FossilOrigin-Name: 0f924c6ef6cf2ac5a61aafa8dd8e3309b3970499
This commit is contained in:
@@ -4675,6 +4675,7 @@ int sqlite3Select(
|
||||
** In practice the KeyInfo structure will not be used. It is only
|
||||
** passed to keep OP_OpenRead happy.
|
||||
*/
|
||||
if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab);
|
||||
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
||||
if( pIdx->bUnordered==0
|
||||
&& pIdx->szIdxRow<pTab->szTabRow
|
||||
@@ -4682,8 +4683,6 @@ int sqlite3Select(
|
||||
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
|
||||
){
|
||||
pBest = pIdx;
|
||||
}else if( pIdx->autoIndex==2 && pBest==0 && !HasRowid(pTab) ){
|
||||
pBest = pIdx;
|
||||
}
|
||||
}
|
||||
if( pBest ){
|
||||
|
||||
Reference in New Issue
Block a user