diff options
author | drh <drh@noemail.net> | 2013-11-12 15:33:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-11-12 15:33:40 +0000 |
commit | 5c7917e4b440839b35299d0486e7aa5418f53cee (patch) | |
tree | b39bf806dcaff4c53ba21ae96d8aa28c8ceeef24 /src | |
parent | abcc1941db3481c8ca05b4cde66df083329087a8 (diff) | |
download | sqlite-5c7917e4b440839b35299d0486e7aa5418f53cee.tar.gz sqlite-5c7917e4b440839b35299d0486e7aa5418f53cee.zip |
A better (simpler) fix to the count(*) problem addressed in the previous
check-in.
FossilOrigin-Name: 0f924c6ef6cf2ac5a61aafa8dd8e3309b3970499
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c index 3c7501376..5cdef3aed 100644 --- a/src/select.c +++ b/src/select.c @@ -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 ){ |