Opened 12 years ago
Last modified 12 years ago
#845 assigned defect
FdoDateTime: Avoid returning invalid DateTime values
Reported by: | gregboone | Owned by: | gregboone |
---|---|---|---|
Priority: | minor | Milestone: | 3.7.0 |
Component: | FDO API | Version: | 3.7.0 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description (last modified by )
When using the FDO Expression Engine or when accessing FDO data stores using the FDO managed API, there exists a slight possibility that:
1) a corrupted date (year == 0) may be returned from the expression engine
2) an exception may be thrown when reading an unmanaged FdoDateTime value and converting it to a System.DateTime value
For the Expression Engine, exceptions are thrown for invalid months/days/etc... so an invalid year should also be handled in the same manner. It is a long term goal that the EE become more forgiving when handling DateTime values, but that larger change is not currently in scope for FDO 3.8.
For the FDO Managed API, the date conversion typically happens when reading date values using the FdoIReader interface. Throwing exceptions when reading invalid data store dates can be fatal to an application and in retrospect does not need to be treated as a hard failure.
Change History (2)
comment:1 by , 12 years ago
Description: | modified (diff) |
---|---|
Status: | new → assigned |
On second thought...
If we come accross a year value that is <= 0, we can simply be a little forgiving and set it to the 'default' value of 1.