mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
"make test" now passing.
FossilOrigin-Name: addd7f466d6ff55f82d907286650c26b06e9397b
This commit is contained in:
13
src/where.c
13
src/where.c
@@ -1908,7 +1908,8 @@ static WhereCost whereCostFromDouble(double x){
|
||||
** logN is a little off.
|
||||
*/
|
||||
static WhereCost estLog(WhereCost N){
|
||||
return whereCostFromInt(N) - 33;
|
||||
WhereCost x = whereCostFromInt(N);
|
||||
return x>33 ? x - 33 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4431,7 +4432,8 @@ static int whereLoopAddBtree(
|
||||
|
||||
/* Automatic indexes */
|
||||
if( !pBuilder->pBest
|
||||
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
|
||||
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
|
||||
&& pSrc->pIndex==0
|
||||
&& !pSrc->viaCoroutine
|
||||
&& !pSrc->notIndexed
|
||||
&& !pSrc->isCorrelated
|
||||
@@ -5526,6 +5528,13 @@ WhereInfo *sqlite3WhereBegin(
|
||||
pWhere = 0;
|
||||
}
|
||||
|
||||
/* Special case: No FROM clause
|
||||
*/
|
||||
if( nTabList==0 ){
|
||||
if( pOrderBy ) pWInfo->bOBSat = 1;
|
||||
if( pDistinct ) pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
|
||||
}
|
||||
|
||||
/* Assign a bit from the bitmask to every term in the FROM clause.
|
||||
**
|
||||
** When assigning bitmask values to FROM clause cursors, it must be
|
||||
|
||||
Reference in New Issue
Block a user