fcl-db: sqldb: simplify code, remove unused field (FSQLBuf)

git-svn-id: trunk@27858 -
This commit is contained in:
lacak 2014-06-05 10:42:23 +00:00
parent 217ab9879c
commit feff396633

View File

@ -363,7 +363,6 @@ type
FLoadingFieldDefs : boolean; FLoadingFieldDefs : boolean;
FUpdateMode : TUpdateMode; FUpdateMode : TUpdateMode;
FusePrimaryKeyAsKey : Boolean; FusePrimaryKeyAsKey : Boolean;
FSQLBuf : String;
FWhereStartPos : integer; FWhereStartPos : integer;
FWhereStopPos : integer; FWhereStopPos : integer;
FServerFilterText : string; FServerFilterText : string;
@ -2127,7 +2126,7 @@ begin
if not Cursor.FSelectable then if not Cursor.FSelectable then
Exit; Exit;
If LogEvent(detFetch) then If LogEvent(detFetch) then
Log(detFetch,FSQLBuf); Log(detFetch,FStatement.FServerSQL);
if not FIsEof then FIsEOF := not SQLConnection.Fetch(Cursor); if not FIsEof then FIsEOF := not SQLConnection.Fetch(Cursor);
Result := not FIsEOF; Result := not FIsEOF;
end; end;
@ -2236,24 +2235,21 @@ begin
begin begin
CreateFields; CreateFields;
if FUpdateable and (not IsUniDirectional) then if FUpdateable and FusePrimaryKeyAsKey and (not IsUniDirectional) then
begin begin
if FusePrimaryKeyAsKey then for counter := 0 to ServerIndexDefs.Count-1 do
begin begin
for counter := 0 to ServerIndexDefs.count-1 do if ixPrimary in ServerIndexDefs[counter].Options then
begin begin
if ixPrimary in ServerIndexDefs[counter].options then IndexFields := TStringList.Create;
ExtractStrings([';'],[' '],pchar(ServerIndexDefs[counter].Fields),IndexFields);
for fieldc := 0 to IndexFields.Count-1 do
begin begin
IndexFields := TStringList.Create; F := FindField(IndexFields[fieldc]);
ExtractStrings([';'],[' '],pchar(ServerIndexDefs[counter].fields),IndexFields); if F <> nil then
for fieldc := 0 to IndexFields.Count-1 do F.ProviderFlags := F.ProviderFlags + [pfInKey];
begin
F := FindField(IndexFields[fieldc]);
if F <> nil then
F.ProviderFlags := F.ProviderFlags + [pfInKey];
end;
IndexFields.Free;
end; end;
IndexFields.Free;
end; end;
end; end;
end; end;