mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 20:39:43 +02:00
fcl-db/dbase: fix for HasBlob only returning true if last field is blob
git-svn-id: trunk@24340 -
This commit is contained in:
parent
11a915e682
commit
e78c2e05ef
@ -68,7 +68,7 @@ type
|
||||
FDateTimeHandling: TDateTimeHandling;
|
||||
FOnLocaleError: TDbfLocaleErrorEvent;
|
||||
FOnIndexMissing: TDbfIndexMissingEvent;
|
||||
|
||||
// Yes if table has blob/memo type field(s) (storage in external file)
|
||||
function HasBlob: Boolean;
|
||||
function GetMemoExt: string;
|
||||
|
||||
@ -686,7 +686,7 @@ begin
|
||||
end;
|
||||
// begin writing field definitions
|
||||
FFieldDefs.Clear;
|
||||
// deleted mark 1 byte
|
||||
// deleted mark takes 1 byte, so skip over that
|
||||
lFieldOffset := 1;
|
||||
for I := 1 to AFieldDefs.Count do
|
||||
begin
|
||||
@ -875,8 +875,11 @@ var
|
||||
begin
|
||||
Result := false;
|
||||
for I := 0 to FFieldDefs.Count-1 do
|
||||
if FFieldDefs.Items[I].IsBlob then
|
||||
if FFieldDefs.Items[I].IsBlob then
|
||||
begin
|
||||
Result := true;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDbfFile.GetMemoExt: string;
|
||||
|
@ -66,6 +66,7 @@ type
|
||||
procedure CheckSizePrecision;
|
||||
procedure SetDefaultSize;
|
||||
procedure AllocBuffers;
|
||||
// Yes if field is a blob/memo type field (storage in external file)
|
||||
function IsBlob: Boolean;
|
||||
|
||||
property DefaultBuf: PChar read FDefaultBuf;
|
||||
|
@ -38,7 +38,7 @@ type
|
||||
end;
|
||||
|
||||
{ TDBFAutoClean }
|
||||
// DBF descendant that saves to a temp file and removes file when closed
|
||||
// DBF descendant that saves to a memory stream instead of file
|
||||
TDBFAutoClean = class(TDBF)
|
||||
private
|
||||
FBackingStream: TMemoryStream;
|
||||
|
@ -90,7 +90,7 @@ begin
|
||||
CheckEquals('TestName' + inttostr(i),ADBFDataset.fieldbyname('NAME').AsString);
|
||||
ADBFDataset.next;
|
||||
end;
|
||||
CheckTrue(ADBFDataset.EOF);
|
||||
CheckTrue(ADBFDataset.EOF,'After reading all records the dataset should show EOF');
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user