mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 14:29:34 +02:00
* Free cached queries when committing
This commit is contained in:
parent
3c2ab09a48
commit
c34eedb9cf
packages/fpindexer/src
@ -35,6 +35,7 @@ type
|
||||
function InsertLanguage(const ALanguage: UTF8String): int64; override;
|
||||
function CreateConnection: TSQLConnection; override;
|
||||
function GetID(TableType: TIndexTable): int64;
|
||||
procedure CommitTrans; override;
|
||||
procedure FinishCreateTable(const TableType: TIndexTable); override;
|
||||
procedure FinishDropTable(const TableType: TIndexTable); override;
|
||||
end;
|
||||
@ -60,6 +61,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPGIndexDB.CommitTrans;
|
||||
|
||||
Var
|
||||
Tbl : TIndexTable;
|
||||
|
||||
begin
|
||||
for Tbl in TIndexTable do
|
||||
FreeAndNil(FGenQuery[Tbl]);
|
||||
inherited CommitTrans;
|
||||
end;
|
||||
|
||||
function TPGIndexDB.InsertLanguage(const ALanguage: UTF8String): int64;
|
||||
var
|
||||
Q: TSQLQuery;
|
||||
|
@ -147,6 +147,8 @@ function TSQLDBIndexDB.GetWordID(const AWord: UTF8String): int64;
|
||||
var
|
||||
Q: TSQLQuery;
|
||||
begin
|
||||
if aWord='Just' then
|
||||
Writeln('here');
|
||||
if (FLastWord = AWord) then
|
||||
Result := FLastWordID
|
||||
else
|
||||
@ -368,7 +370,11 @@ begin
|
||||
end;
|
||||
|
||||
procedure TSQLDBIndexDB.CommitTrans;
|
||||
Var
|
||||
T : TCachedQueryType;
|
||||
begin
|
||||
For T:=Low(TCachedQueryType) to High(TCachedQueryType) do
|
||||
FreeAndNil(FQueries[T]);
|
||||
FDB.Transaction.Commit;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user