Error when loading any dataset from TIBCQuery through TDataSetProvider
Posted: Wed 15 Nov 2017 16:10
Hello IBDAC team,
I encountered an error when I upgraded to the latest IBDAC version - 6.1.4.
I try to load a TClientDataSet from TIBCQuery through TDataSetProvider. The query selects just 3 fields - a bigint, a date and a double precision field:
When I do this, an error is raised - '0.0' is not a valid timestamp. I found that this problem appears when the persistent fields in the query and the client dataset are ordered differently. Loading of the data does not find the correct fields to load data from and this causes the error.
I think I found which method causes the issue in module MemDS.pas. I replaced the code with the old version from IBDAC 5.7 and the problem disappeared:
I will send you a zip file to viktorv*devart*com, containing a project to simulate the issue and a simple script to create a test database.
I encountered an error when I upgraded to the latest IBDAC version - 6.1.4.
I try to load a TClientDataSet from TIBCQuery through TDataSetProvider. The query selects just 3 fields - a bigint, a date and a double precision field:
Code: Select all
cdsTest.Close;
ibqTest.Close;
ibqTest.Open;
cdsTest.Data := prvTest.Data;
I think I found which method causes the issue in module MemDS.pas. I replaced the code with the old version from IBDAC 5.7 and the problem disappeared:
Code: Select all
{$IFNDEF FPC}
function TMemDataSet.GetFieldData(FieldNo: integer; Buffer: IntPtr): boolean;
var
RecBuf: TRecordBuffer;
Field: TField;
{BEGIN FIX version 5.7.}
IsBlank: boolean;
FieldDesc: TFieldDesc;
{END FIX}
begin
//if BlockReadSize > 0 then
Result := GetActiveRecBuf(RecBuf);
if Result then begin
Assert(Data <> nil);
{BEGIN FIX}
//ORIGINAL CODE - version 6.1.4. - this causes the problem
{if FieldNo > 0 then
Field := Fields[FieldNo - 1]
else
Field := FieldByNumber(FieldNo);
if Field <> nil then begin
Result := GetFieldData(Field, Buffer);
if Result and (Field.DataType in [ftBCD, ftSmallint, ftWord]) then
Result := InternalDataConvert(Field, Buffer, Buffer, True);}
//FIXED CODE - version 5.7. - this works fine
FieldDesc := GetFieldDesc(FieldNo);
Data.GetField(FieldDesc, RecBuf, Buffer, True, IsBlank);
Result := not IsBlank;
if Result then begin
Field := FieldByNumber(FieldNo);
if Field.DataType in [ftBCD, ftSmallint, ftWord] then
Result := InternalDataConvert(Field, Buffer, Buffer, True);
{END FIX}
end
else
Result := False;
end;
end;
{$ENDIF}