1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

In the STAT4 computations, ensure that the aAvgEq values do not go negative.

FossilOrigin-Name: f58f75b5a06f88ba97bd1a02bee621c64691c6f8
This commit is contained in:
drh
2017-01-11 14:15:29 +00:00
parent f112f0b3de
commit 785d8ed0d4
3 changed files with 9 additions and 9 deletions

View File

@@ -1615,7 +1615,7 @@ static void initAvgEq(Index *pIdx){
}
}
if( nDist100>nSum100 ){
if( nDist100>nSum100 && sumEq<nRow ){
avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
}
if( avgEq==0 ) avgEq = 1;