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

$multiply incorrectly throws an error in some cases in the classic engine

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.4.11, 4.2.18, 4.0.28, 5.0.4, 5.1.0-rc2
    • None
    • None
    • Fully Compatible
    • ALL
    • v5.1, v5.0, v4.4, v4.2, v4.0
    • QE 2021-10-18, QE 2021-11-01
    • 149

    Description

      I came across a simple case in the classic engine where $multiply throws an error when it shouldn't. Here is the repro:

      > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true});
      > db.c.drop();
      > db.c.insert({a: 1.0});
      > db.c.find({}, {x: {$multiply: ["$a", 1.0e+35]}})

      When I run the commands above in the classic engine, I get the following error:

      "Executor error during find command :: caused by :: Can't coerce out of range value -9.8696e+34 to long"

      The example above is simply multiplying the double 1.0 by the double 1.0e+35. There is no reason that this operation should fail.

      The goal of this task is to investigate why the failure described above is occurring, and to implement the appropriate fix.

      As part of this work, once the issue is solved, $multiply should be marked as sbe-compatible again (undoing SERVER-60583.)

      Attachments

        Issue Links

          Activity

            People

              jennifer.peshansky@mongodb.com Jennifer Peshansky
              andrew.paroski@mongodb.com Drew Paroski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: