Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60528

Fix how SBE performs comparisons between 64-bit integers and doubles

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0, 5.1.0-rc1
    • Affects Version/s: 5.2.0, 5.1.0-rc0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.1
    • Hide

       

      > db.c.drop()
      > db.c.insert({_id: 1, a: 9007199254740992})
      > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false})
      > db.c.find({a: NumberLong("9007199254740993")}).itcount()
      1
      
      > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true})
      > db.c.find({a: NumberLong("9007199254740993")}).itcount()
      0

       

      Show
        > db.c.drop() > db.c.insert({_id: 1, a: 9007199254740992}) > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false}) > db.c.find({a: NumberLong("9007199254740993")}).itcount() 1 > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true}) > db.c.find({a: NumberLong("9007199254740993")}).itcount() 0  
    • QE 2021-10-18

      There are some cases where SBE produces results that don't agree with the classic engine when performing comparisons between 64-bit integers and doubles.

      Here is an example of a query that produces different results under SBE vs. the classic engine:

      > db.c.insert({a: 9007199254740992})
      > db.c.find({a: NumberLong("9007199254740993")})

      Under SBE, (assuming there is no index on field "a") the query above will return 1 document. Under the classic engine the query above will return 0 documents.

      The goal of this task is to fix this inconsistency so that SBE and classic engine produce the same results when performing comparisons between 64-bit integers and doubles. 

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            andrew.paroski@mongodb.com Drew Paroski
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: