mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-21 09:00:59 +03:00
Additional unlikely() test cases. Logic tweaks to support test coverage.
FossilOrigin-Name: 5d00cce74a7aefaf30022ae971ab1e0451e0ad6e
This commit is contained in:
@@ -579,7 +579,8 @@ static int exprProbability(Expr *p){
|
||||
double r = -1.0;
|
||||
if( p->op!=TK_FLOAT ) return -1;
|
||||
sqlite3AtoF(p->u.zToken, &r, sqlite3Strlen30(p->u.zToken), SQLITE_UTF8);
|
||||
if( r<0.0 || r>1.0 ) return -1;
|
||||
assert( r>=0.0 );
|
||||
if( r>1.0 ) return -1;
|
||||
return (int)(r*1000.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ static int whereClauseInsert(WhereClause *pWC, Expr *p, u8 wtFlags){
|
||||
pTerm = &pWC->a[idx = pWC->nTerm++];
|
||||
if( wtFlags & TERM_VIRTUAL ){
|
||||
pTerm->truthProb = 0;
|
||||
}else if( p && ExprHasAnyProperty(p, EP_Hint) ){
|
||||
}else if( ALWAYS(p) && ExprHasAnyProperty(p, EP_Hint) ){
|
||||
pTerm->truthProb = whereCost(p->iTable) - 99;
|
||||
}else{
|
||||
pTerm->truthProb = -1;
|
||||
|
||||
Reference in New Issue
Block a user