aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c3
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 ){