Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-643

The type of AVG should always be double (not the type of the field)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JDO 2 maintenance release 2 (2.2)
    • JDO 3.1-rc1
    • specification, tck
    • None

    Description

      Aggregate type specification at page 175 claims that avg(expression) return type is the same of the enclosed expression.
      This is wrong from a strictly mathematical point of view.
      In fact, if you select an avg on an int field member the result is truncated.
      The result type should always be double.

      Attachments

        1. JDO-643.patch
          1 kB
          Andy Jefferson

        Activity

          People

            mbo Michael Bouschen
            ganzuoni Guido Anzuoni
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: