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}