You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tom Hill (JIRA)" <ji...@apache.org> on 2015/12/15 21:21:46 UTC

[jira] [Updated] (SOLR-8420) Date statistics: sumOfSquares overflows long

     [ https://issues.apache.org/jira/browse/SOLR-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Hill updated SOLR-8420:
---------------------------
    Attachment: 0001-Fix-overflow-in-date-statistics.patch

One line fix, plus tests.

> Date statistics: sumOfSquares overflows long
> --------------------------------------------
>
>                 Key: SOLR-8420
>                 URL: https://issues.apache.org/jira/browse/SOLR-8420
>             Project: Solr
>          Issue Type: Bug
>          Components: SearchComponents - other
>    Affects Versions: 5.4
>            Reporter: Tom Hill
>            Priority: Minor
>         Attachments: 0001-Fix-overflow-in-date-statistics.patch
>
>
> The values for Dates are large enough that squaring them overflows a "long" field. This should be converted to a double. 
> StatsValuesFactory.java, line 755 DateStatsValues#updateTypeSpecificStats Add a cast to double 
> sumOfSquares += ( (double)value * value * count);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org