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:
lacak 2014-01-30 09:03:40 +00:00
parent 03e76b5f8b
commit c4a981fa8e

View File

@ -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;