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

$dateAdd/$dateSubtract do not detect an overflow for certain 'amount' values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.0, 5.1.0
    • 5.0.4, 5.1.0-rc0
    • None
    • None
    • Minor Change
    • ALL
    • v5.0
    • QE 2021-09-06, QE 2021-09-20
    • 136

    Description

      $dateAdd/$dateSubtract expressions do not detect an overflow for certain 'amount' values. A result is undefined in such cases. An example of an expression that overflows:

          {"$dateAdd":
                  {"startDate" : Timestamp(0, 4294967295),
                  "unit" : "month",
                  "amount" :  {$multiply: [NumberLong("314159265358979383")]},
                  "timezone" : "+1187" }};
      

      Attachments

        Issue Links

          Activity

            People

              mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
              mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: