mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Make sure the estLog() routine in the query planner handles negative
values correctly (always returning 1). Prior to this change, estLog(-1) would return a large number which could throw off the cost computations in the query planner in obscure circumstances. FossilOrigin-Name: 75437bee4905949c66dc7694ea234d4d5aefd981
This commit is contained in:
@@ -1494,7 +1494,7 @@ static int isDistinctRedundant(
|
||||
** Estimate the logarithm of the input value to base 2.
|
||||
*/
|
||||
static LogEst estLog(LogEst N){
|
||||
LogEst x = sqlite3LogEst(N);
|
||||
LogEst x = N<0 ? 1 : sqlite3LogEst(N);
|
||||
return x>33 ? x - 33 : 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user