/ Check-in [f58f75b5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the STAT4 computations, ensure that the aAvgEq values do not go negative.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f58f75b5a06f88ba97bd1a02bee621c64691c6f8
User & Date: drh 2017-01-11 14:15:29
Context
2017-01-11
21:03
Changes to allow some multi-row UPDATE statements to avoid the two-pass approach. check-in: 7ae6104a user: dan tags: trunk
16:52
Attempt to detect physical sector sizes on Windows 8 and higher. check-in: 381fd34b user: mistachkin tags: winSectorSize
14:21
In the STAT4 computations, ensure that the aAvgEq values do not go negative. check-in: 4f83f680 user: drh tags: branch-3.8.9
14:15
In the STAT4 computations, ensure that the aAvgEq values do not go negative. check-in: f58f75b5 user: drh tags: trunk
2017-01-10
17:37
Add a test case for ticket [25e335f802dd]. check-in: e500c15a user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/analyze.c.

1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
         || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] 
        ){
          sumEq += aSample[i].anEq[iCol];
          nSum100 += 100;
        }
      }

      if( nDist100>nSum100 ){
        avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
      }
      if( avgEq==0 ) avgEq = 1;
      pIdx->aAvgEq[iCol] = avgEq;
    }
  }
}







|







1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
         || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] 
        ){
          sumEq += aSample[i].anEq[iCol];
          nSum100 += 100;
        }
      }

      if( nDist100>nSum100 && sumEq<nRow ){
        avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
      }
      if( avgEq==0 ) avgEq = 1;
      pIdx->aAvgEq[iCol] = avgEq;
    }
  }
}