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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.3.0, 5.2.1
    • 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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: