mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +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;
|
FDateTimeHandling: TDateTimeHandling;
|
||||||
FOnLocaleError: TDbfLocaleErrorEvent;
|
FOnLocaleError: TDbfLocaleErrorEvent;
|
||||||
FOnIndexMissing: TDbfIndexMissingEvent;
|
FOnIndexMissing: TDbfIndexMissingEvent;
|
||||||
|
// Yes if table has blob/memo type field(s) (storage in external file)
|
||||||
function HasBlob: Boolean;
|
function HasBlob: Boolean;
|
||||||
function GetMemoExt: string;
|
function GetMemoExt: string;
|
||||||
|
|
||||||
@ -686,7 +686,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
// begin writing field definitions
|
// begin writing field definitions
|
||||||
FFieldDefs.Clear;
|
FFieldDefs.Clear;
|
||||||
// deleted mark 1 byte
|
// deleted mark takes 1 byte, so skip over that
|
||||||
lFieldOffset := 1;
|
lFieldOffset := 1;
|
||||||
for I := 1 to AFieldDefs.Count do
|
for I := 1 to AFieldDefs.Count do
|
||||||
begin
|
begin
|
||||||
@ -875,8 +875,11 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
for I := 0 to FFieldDefs.Count-1 do
|
for I := 0 to FFieldDefs.Count-1 do
|
||||||
if FFieldDefs.Items[I].IsBlob then
|
if FFieldDefs.Items[I].IsBlob then
|
||||||
|
begin
|
||||||
Result := true;
|
Result := true;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbfFile.GetMemoExt: string;
|
function TDbfFile.GetMemoExt: string;
|
||||||
|
@ -66,6 +66,7 @@ type
|
|||||||
procedure CheckSizePrecision;
|
procedure CheckSizePrecision;
|
||||||
procedure SetDefaultSize;
|
procedure SetDefaultSize;
|
||||||
procedure AllocBuffers;
|
procedure AllocBuffers;
|
||||||
|
// Yes if field is a blob/memo type field (storage in external file)
|
||||||
function IsBlob: Boolean;
|
function IsBlob: Boolean;
|
||||||
|
|
||||||
property DefaultBuf: PChar read FDefaultBuf;
|
property DefaultBuf: PChar read FDefaultBuf;
|
||||||
|
@ -38,7 +38,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TDBFAutoClean }
|
{ 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)
|
TDBFAutoClean = class(TDBF)
|
||||||
private
|
private
|
||||||
FBackingStream: TMemoryStream;
|
FBackingStream: TMemoryStream;
|
||||||
|
@ -90,7 +90,7 @@ begin
|
|||||||
CheckEquals('TestName' + inttostr(i),ADBFDataset.fieldbyname('NAME').AsString);
|
CheckEquals('TestName' + inttostr(i),ADBFDataset.fieldbyname('NAME').AsString);
|
||||||
ADBFDataset.next;
|
ADBFDataset.next;
|
||||||
end;
|
end;
|
||||||
CheckTrue(ADBFDataset.EOF);
|
CheckTrue(ADBFDataset.EOF,'After reading all records the dataset should show EOF');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user