Changes between Version 13 and Version 14 of FDORfc55
- Timestamp:
- 06/01/11 13:42:25 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc55
v13 v14 1 = FDO RFC 55 - Convert FdoDecimal(p,0) datatype to FdoIntXX for SHP Provider =1 = FDO RFC 55 - Convert !FdoDecimal(p,0) datatype to FdoIntXX for SHP Provider = 2 2 3 3 This page contains an change request (RFC) for the FDO Open Source project. … … 33 33 >> If you execute an IApplySchema on a SHP connection. Any Int32 properties in any class definitions inside the schema (to be applied) will be converted to Decimal properties once the schema has been applied. This does not happen if the Int32 property happens to be an Identity property. << 34 34 35 For further clarification "will be converted to Decimal properties" refer to FdoDecimal properties.35 For further clarification "will be converted to Decimal properties" refer to !FdoDecimal properties. 36 36 37 Note storing !FdoInt32 as Decimals is expected since by specification DBF files natively do not have an integer type, but only DECIMAL(precision, scale) datatype. The same apply to double and single precision datatypes. Hence a integer type like FdoInt32 is mapped to a DECIMAL(11, 0) column type.37 Note storing !FdoInt32 as Decimals is expected since by specification DBF files natively do not have an integer type, but only DECIMAL(precision, scale) datatype. The same apply to double and single precision datatypes. Hence a integer type like !FdoInt32 is mapped to a DECIMAL(11, 0) column type. 38 38 39 The impact is on Describe Schema when currently a FdoDecimal is returned for a DECIMAL column even in the cases when the scale is zero and most probably the original type was aFdoInt32.39 The impact is on Describe Schema when currently a !FdoDecimal is returned for a DECIMAL column even in the cases when the scale is zero and most probably the original type was a !FdoInt32. 40 40 41 This RFC is required since reading back a FdoInt32 instead of a FdoDecimal is a change in behavior. For completitude FdoInt16 andFdoInt64 have been added to the scope.41 This RFC is required since reading back a !FdoInt32 instead of a !FdoDecimal is a change in behavior. For completitude !FdoInt16 and !FdoInt64 have been added to the scope. 42 42 43 43 == Proposed Solution == … … 45 45 Modify the FDO SHP provider: 46 46 47 * the DBF to FDO datatype mapping (physical to logical conversion) needs a small refinement. In the case of DECIMAL(precision, scale) check the scale value. When the scale is 0 (zero) and depending on the precision return FdoInt16, FdoInt32 or FdoInt64 rather than an FdoDecimal. Note SHP provider currently does not support FdoInt64 orFdoInt16 datatypes and they have to be added to the schema capabilities.47 * the DBF to FDO datatype mapping (physical to logical conversion) needs a small refinement. In the case of DECIMAL(precision, scale) check the scale value. When the scale is 0 (zero) and depending on the precision return !FdoInt16, !FdoInt32 or !FdoInt64 rather than an !FdoDecimal. Note SHP provider currently does not support !FdoInt64 or !FdoInt16 datatypes and they have to be added to the schema capabilities. 48 48 49 49 Below the mapping between FdoIntXX datatypes and Decimal precision: 50 50 51 51 || Fdo type || precision || range || 52 || FdoInt16 || 1...6 || -32,768 to 32,767 ||53 || FdoInt32 || 7...11 || -2,147,483,648 to 2,147,483,647 ||54 || FdoInt64 || 12...20 || -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 ||52 || !FdoInt16 || 1...6 || -32,768 to 32,767 || 53 || !FdoInt32 || 7...11 || -2,147,483,648 to 2,147,483,647 || 54 || !FdoInt64 || 12...20 || -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 || 55 55 56 Note: beyond the FdoInt64 range the current behaviour will be preserved, i.e. the property type will remainFdoDecimal and a data reader will return a Double.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. 57 57 58 58 == Implications == 59 59 60 * In the case of physical DECIMAL(precision, scale) column the corresponding logical FDO property type will be set according to the scale. The caller must expect either a FdoDecimal or a FdoIntXX when reading a SHP schema.60 * In the case of physical DECIMAL(precision, scale) column the corresponding logical FDO property type will be set according to the scale. The caller must expect either a !FdoDecimal or a FdoIntXX when reading a SHP schema. 61 61 62 * This is a behavior change for the SHP provider. Before this change, SHP would return only FdoDecimal for all numerical FDO types. It would never return an FdoIntXX except for the identity property (which actually is not stored).62 * This is a behavior change for the SHP provider. Before this change, SHP would return only !FdoDecimal for all numerical FDO types. It would never return an FdoIntXX except for the identity property (which actually is not stored). 63 63 64 64 * 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). … … 66 66 == Test Plan == 67 67 68 * Enhance the unit test and add roundtripping fidelity tests for FdoInt16, FdoInt32 andFdoInt64 properties.68 * Enhance the unit test and add roundtripping fidelity tests for !FdoInt16, !FdoInt32 and !FdoInt64 properties. 69 69 70 70 == !Funding/Resources ==