mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 04:25:59 +02:00
fcl-db: bufdataset: when index is added set IndexDefs.Updated to false to signal, that FIndexDefs and FIndexes are not synchronized. This allow next call to IndexDefs.Update (which tests Updated) do synchronization.
git-svn-id: trunk@23723 -
This commit is contained in:
parent
c7f1569156
commit
1533aff2cc
@ -1682,20 +1682,21 @@ begin
|
|||||||
inc(FIndexesCount);
|
inc(FIndexesCount);
|
||||||
setlength(FIndexes,FIndexesCount); // This invalidates the currentindex! -> not anymore
|
setlength(FIndexes,FIndexesCount); // This invalidates the currentindex! -> not anymore
|
||||||
FCurrentIndex:=FIndexes[StoreIndNr];
|
FCurrentIndex:=FIndexes[StoreIndNr];
|
||||||
|
|
||||||
if IsUniDirectional then
|
if IsUniDirectional then
|
||||||
FIndexes[FIndexesCount-1] := TUniDirectionalBufIndex.Create(self)
|
FIndexes[FIndexesCount-1] := TUniDirectionalBufIndex.Create(self)
|
||||||
else
|
else
|
||||||
FIndexes[FIndexesCount-1] := TDoubleLinkedBufIndex.Create(self);
|
FIndexes[FIndexesCount-1] := TDoubleLinkedBufIndex.Create(self);
|
||||||
// FIndexes[FIndexesCount-1] := TArrayBufIndex.Create(self);
|
// FIndexes[FIndexesCount-1] := TArrayBufIndex.Create(self);
|
||||||
FIndexes[FIndexesCount-1].InitialiseIndex;
|
with FIndexes[FIndexesCount-1] do
|
||||||
with (FIndexes[FIndexesCount-1] as TBufIndex) do
|
|
||||||
begin
|
begin
|
||||||
|
InitialiseIndex;
|
||||||
|
IndNr:=FIndexesCount-1;
|
||||||
Name:=AName;
|
Name:=AName;
|
||||||
FieldsName:=AFields;
|
FieldsName:=AFields;
|
||||||
DescFields:=ADescFields;
|
DescFields:=ADescFields;
|
||||||
CaseinsFields:=ACaseInsFields;
|
CaseinsFields:=ACaseInsFields;
|
||||||
Options:=AOptions;
|
Options:=AOptions;
|
||||||
IndNr:=FIndexesCount-1;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Active then
|
if Active then
|
||||||
@ -1705,6 +1706,8 @@ begin
|
|||||||
end
|
end
|
||||||
else if FIndexesCount>FMaxIndexesCount then
|
else if FIndexesCount>FMaxIndexesCount then
|
||||||
FMaxIndexesCount := FIndexesCount;
|
FMaxIndexesCount := FIndexesCount;
|
||||||
|
|
||||||
|
FIndexDefs.Updated:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomBufDataset.SetIndexFieldNames(const AValue: String);
|
procedure TCustomBufDataset.SetIndexFieldNames(const AValue: String);
|
||||||
@ -1721,6 +1724,7 @@ begin
|
|||||||
BuildIndex(FIndexes[1]);
|
BuildIndex(FIndexes[1]);
|
||||||
Resync([rmCenter]);
|
Resync([rmCenter]);
|
||||||
end;
|
end;
|
||||||
|
FIndexDefs.Updated:=false;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
SetIndexName('');
|
SetIndexName('');
|
||||||
|
Loading…
Reference in New Issue
Block a user