Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8420

Date statistics: sumOfSquares overflows long

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.5.1, 6.0
    • Labels:
      None

      Description

      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);

        Attachments

        1. StdDev.java
          1 kB
          Tom Hill
        2. SOLR-8420.patch
          8 kB
          Tomás Fernández Löbbe
        3. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill
        4. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill
        5. 0001-Fix-overflow-in-date-statistics.patch
          8 kB
          Tom Hill

          Activity

            People

            • Assignee:
              tomasflobbe Tomás Fernández Löbbe
              Reporter:
              tomsolr Tom Hill
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: