Changes between Version 14 and Version 15 of FDORfc55


Ignore:
Timestamp:
06/06/11 13:35:01 (13 years ago)
Author:
danstoica
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc55

    v14 v15  
    4949Below the mapping between FdoIntXX datatypes and Decimal precision:
    5050
    51 || Fdo type ||  precision ||                    range                                ||
     51|| Fdo type  ||  precision ||                    range                                ||
    5252|| !FdoInt16 ||  1...6     || -32,768 to 32,767                                       ||
    5353|| !FdoInt32 ||  7...11    || -2,147,483,648 to 2,147,483,647                         ||
    5454|| !FdoInt64 ||  12...20   || -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 ||
    5555
    56 Note: beyond the !FdoInt64 range the current behaviour will be preserved, i.e. the property type will remain !FdoDecimal and a data reader will return a Double.
     56Note: beyond the !FdoInt64 range the current behaviour will be preserved, i.e. the property type will remain !FdoDecimal.
     57
     58But assume a SHP file with a column of DECIMAL(4,0). DescribeSchema will return that as a FdoInt16. On an insert operation we need to make sure the user has enough information to avoid values out of (-999, 999) range. Or in an ApplySchema operation we need to treat the Int16 as DECIMAL(6,0) as opposed to DECIMAL(4,0) to be sure it can handle the full range. Therefore a suplimentary change is needed: the FdoPropertyDefinition will return FdoIntXX datatype but retain the original Precision (the Scale is implicit zero).
     59
    5760
    5861== Implications ==
     
    6467    * The provider will return a FdoIntXX even for properties which originally were DECIMAL(p, 0). This issue can be mitigated by noting the SHP provider already does silent corrections on the fly in certain cases, like truncating the property names when found too long (both on reading and writing).
    6568
     69    * The FdoDataPropertyDefinition documentation will be change to reflect that precision apply to all integer types not only for decimals. In case the precision is not set (zero) then the full range is assumed. This is the current behavior.
     70
     71{{{
     72    /// \brief
     73    /// Gets the precision (total number of digits) of a decimal or integer data property.
     74    /// This value does not apply to any other FdoDataType.
     75    ///
     76    FDO_API FdoInt32 GetPrecision();
     77
     78}}
     79
    6680== Test Plan ==
    6781
    68     * Enhance the unit test and add roundtripping fidelity tests for !FdoInt16, !FdoInt32 and !FdoInt64 properties.
     82    * Enhance the unit tests and add roundtripping fidelity tests for !FdoInt16, !FdoInt32 and !FdoInt64 properties.
     83    * Add tests to check for out of range values. Make sure the out-of-range values on insert are detected.
    6984 
    7085== !Funding/Resources ==