View Issue Details

IDProjectCategoryView StatusLast Update
0001327Database Comparer VCLGeneralpublic2019-04-18 19:46
Reportershirokov Assigned Tobarry  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0001327: The DBComparer is unable to extract Firebird 3.0 internal functions.
DescriptionThe following function causes the Invalid typecast problem:

create or alter function CASTFLOAT (
 TEXT varchar(255))
returns float
AS
begin
 return cast(replace(trim(text), ',', '.') as float);
 when any do return null;
end

The problem occurs at the following code line:
fData.Scale := -Integer(Scale); <<<<<< HERE

See the dbcIBDatabaseExtract unit, TIBDBExtract.DecodeNumericType method:

procedure TIBDBExtract.DecodeNumericType(FldType: Integer;
 SubType: Integer;
 Precision: Variant;
 Scale: Variant;
 fData: TFldData;
 fRdbPrecision: Boolean);

else fData.Precision := 0;
 if (not PrecisionKnown) and (Scale < 0) then begin
 case fData.FldType of
 7: // SmallInt (SHORT);
 fData.Precision := 4;
 8: // Integer (LONG)
 fData.Precision := 9;
 27: // Double precision (DOUBLE)
 fData.Precision := 15;
 16: // Bigint
 fData.Precision := 18;
 end;
 fData.Scale := -Integer(Scale); <<<<<< HERE
 if SubType = 0 then begin
 fData.NumericFieldType := fData.FieldType;
 fData.FieldType := iftNumeric;
 end;
 end;
TagsNo tags attached.

Activities

barry

2018-06-01 00:27

administrator   ~0003738

7.0.0.1670

Issue History

Date Modified Username Field Change
2018-04-09 22:13 shirokov New Issue
2018-04-09 22:13 shirokov Status new => assigned
2018-04-09 22:13 shirokov Assigned To => barry
2018-06-01 00:27 barry Status assigned => resolved
2018-06-01 00:27 barry Resolution open => fixed
2018-06-01 00:27 barry Note Added: 0003738
2019-04-18 19:46 barry Status resolved => closed