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

Initialize $add with no operands to zero when translating to SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0, 5.2.1
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • v5.2, v5.1
    • Hide
      db.c.insert({_id: 0, x: 1})
      db.c.aggregate([{$project: {z: {$add: []}}}])
      Show
      db.c.insert({_id: 0, x: 1}) db.c.aggregate([{$project: {z: {$add: []}}}])
    • QE 2022-02-07
    • 191

      This was flagged by the agg optimization fuzzer and I was able to boil down the failing pipeline to just an $add with no args [].

      The classic engine returns 0 as an int in this case so this fix will do the same during sbe translation of $add.

            Assignee:
            eric.cox@mongodb.com Eric Cox (Inactive)
            Reporter:
            eric.cox@mongodb.com Eric Cox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: