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

Date statistics: sumOfSquares overflows long

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.4
    • 5.5.1, 6.0
    • 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. SOLR-8420.patch
          8 kB
          Tomas Eduardo Fernandez Lobbe
        2. 0001-Fix-overflow-in-date-statistics.patch
          8 kB
          Tom Hill
        3. StdDev.java
          1 kB
          Tom Hill
        4. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill
        5. 0001-Fix-overflow-in-date-statistics.patch
          4 kB
          Tom Hill

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tflobbe Tomas Eduardo Fernandez Lobbe Assign to me
            tomsolr Tom Hill
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment