mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 12:47:24 +01:00
* Parse multiple fields in pk properly, bug #7566+test
git-svn-id: trunk@6531 -
This commit is contained in:
parent
fff9fb6afe
commit
1326e7a542
@ -998,9 +998,10 @@ procedure TSQLQuery.InternalOpen;
|
||||
end;
|
||||
|
||||
|
||||
var tel : integer;
|
||||
var tel, fieldc : integer;
|
||||
f : TField;
|
||||
s : string;
|
||||
IndexFields : TStrings;
|
||||
begin
|
||||
try
|
||||
Prepare;
|
||||
@ -1024,10 +1025,15 @@ begin
|
||||
if ixPrimary in indexdefs[tel].options then
|
||||
begin
|
||||
// Todo: If there is more then one field in the key, that must be parsed
|
||||
s := indexdefs[tel].fields;
|
||||
F := Findfield(s);
|
||||
if F <> nil then
|
||||
F.ProviderFlags := F.ProviderFlags + [pfInKey];
|
||||
IndexFields := TStringList.Create;
|
||||
ExtractStrings([';'],[' '],pchar(indexdefs[tel].fields),IndexFields);
|
||||
for fieldc := 0 to IndexFields.Count-1 do
|
||||
begin
|
||||
F := Findfield(IndexFields[fieldc]);
|
||||
if F <> nil then
|
||||
F.ProviderFlags := F.ProviderFlags + [pfInKey];
|
||||
end;
|
||||
IndexFields.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user