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

Float to Double promotion causes comparison fail in ComparisonHelper

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.4
    • Fix Version/s: 0.9.4.1
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: