Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2375

Float to Double promotion causes comparison fail in ComparisonHelper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.4
    • 0.9.4.1
    • None
    • None

    Description

      In the ComparisonHelper, when the two compared values have different types, we promote the lower precision one to higher and compare. This causes an issue when checking equality of float and double, the float is cast to double but failed at comparison as the prevision is widened. One example is
      select * from Supplier s where s.salary = 83.44;

      The 83.44 in the database is casted to 83.4397***** which is not equal to 83.44.

      Attachments

        Activity

          People

            idleft Xikui Wang
            idleft Xikui Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: