mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-02-02 14:49:22 +01:00
fcl-db: bufdataset: TBufDataset autoincrement fields (ftAutoInc) are not restarted when dataset is closed and again reopened. See bug #25628
git-svn-id: trunk@26622 -
This commit is contained in:
parent
03e76b5f8b
commit
c4a981fa8e
@ -1173,7 +1173,6 @@ var IndexNr : integer;
|
||||
i : integer;
|
||||
|
||||
begin
|
||||
FAutoIncField:=nil;
|
||||
if not Assigned(FDatasetReader) and (FileName<>'') then
|
||||
begin
|
||||
FFileStream := TFileStream.Create(FileName,fmOpenRead);
|
||||
@ -1202,6 +1201,7 @@ begin
|
||||
// If there is a field with FieldNo=0 then the fields are not found to the
|
||||
// FieldDefs which is a sign that there is no dataset created. (Calculated and
|
||||
// lookup fields have FieldNo=-1)
|
||||
FAutoIncField:=nil;
|
||||
for i := 0 to Fields.Count-1 do
|
||||
if Fields[i].FieldNo=0 then
|
||||
DatabaseError(SErrNoDataset)
|
||||
@ -1274,7 +1274,7 @@ begin
|
||||
|
||||
SetLength(FFieldBufPositions,0);
|
||||
|
||||
FAutoIncValue:=-1;
|
||||
if FAutoIncValue>-1 then FAutoIncValue:=1;
|
||||
|
||||
if assigned(FParser) then FreeAndNil(FParser);
|
||||
FReadFromFile:=false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user