Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
Fully Compatible
-
ALL
-
Query 2017-08-21, Query 2017-09-11, Sharding 2018-02-12
Description
Currently $dateFromParts will handle appropriately a day that's bigger than largest day in the specified month (i.e. year:2017, month:2, day:30 correctly becomes "2017-03-02" since there are only 28 days in February) but if day is >31 it gives an error. Same for month>12.
”‘day’ must evaluate to an integer in the range 1 to 31, found 32"
Instead it should just construct appropriate date (so 2017, 2, 32 is "2017-03-03" and 2017 month 13 is January of 2018. This allows simple construction of dates that are X days after given date or Y months after given date, etc.
Attachments
Issue Links
- is documented by
-
DOCS-11444 Docs for SERVER-30523: dateFromParts should not reject "out-of-range" numbers for date/time properties
-
- Closed
-
- is related to
-
SERVER-34949 Improved safety for time_support.h API
-
- Closed
-
-
SERVER-40383 dateFromParts does not overflow correctly if isoWeek smaller than 1
-
- Closed
-
- related to
-
SERVER-40573 timelib can read past end of buffer, leads to incorrect time calculations
-
- Closed
-
-
SERVER-16347 Support for date aggregation operator for creating dates from parts
-
- Closed
-