|
@@ -110,6 +110,7 @@ type
|
|
TDBCompareRec = record
|
|
TDBCompareRec = record
|
|
Comparefunc : TCompareFunc;
|
|
Comparefunc : TCompareFunc;
|
|
Off1,Off2 : PtrInt;
|
|
Off1,Off2 : PtrInt;
|
|
|
|
+ Options : TLocateOptions;
|
|
Desc : Boolean;
|
|
Desc : Boolean;
|
|
end;
|
|
end;
|
|
TDBCompareStruct = array of TDBCompareRec;
|
|
TDBCompareStruct = array of TDBCompareRec;
|
|
@@ -355,7 +356,7 @@ var IndexFieldNr : Integer;
|
|
begin
|
|
begin
|
|
for IndexFieldNr:=0 to length(ADBCompareRecs)-1 do with ADBCompareRecs[IndexFieldNr] do
|
|
for IndexFieldNr:=0 to length(ADBCompareRecs)-1 do with ADBCompareRecs[IndexFieldNr] do
|
|
begin
|
|
begin
|
|
- Result := Comparefunc(Rec1+Off1,Rec2+Off2,[]);
|
|
|
|
|
|
+ Result := Comparefunc(Rec1+Off1,Rec2+Off2,Options);
|
|
if Result <> 0 then
|
|
if Result <> 0 then
|
|
begin
|
|
begin
|
|
if Desc then
|
|
if Desc then
|
|
@@ -421,6 +422,7 @@ var PCurRecLinkItem : PBufRecLinkItem;
|
|
|
|
|
|
IndexFields : TList;
|
|
IndexFields : TList;
|
|
DescIndexFields : TList;
|
|
DescIndexFields : TList;
|
|
|
|
+ CInsIndexFields : TList;
|
|
FieldsAmount : Integer;
|
|
FieldsAmount : Integer;
|
|
FieldNr : integer;
|
|
FieldNr : integer;
|
|
AField : TField;
|
|
AField : TField;
|
|
@@ -449,10 +451,12 @@ begin
|
|
begin
|
|
begin
|
|
IndexFields := TList.Create;
|
|
IndexFields := TList.Create;
|
|
DescIndexFields := TList.Create;
|
|
DescIndexFields := TList.Create;
|
|
|
|
+ CInsIndexFields := TList.Create;
|
|
try
|
|
try
|
|
GetFieldList(IndexFields,FieldsName);
|
|
GetFieldList(IndexFields,FieldsName);
|
|
FieldsAmount:=IndexFields.Count;
|
|
FieldsAmount:=IndexFields.Count;
|
|
GetFieldList(DescIndexFields,DescFields);
|
|
GetFieldList(DescIndexFields,DescFields);
|
|
|
|
+ GetFieldList(CInsIndexFields,CaseinsFields);
|
|
if FieldsAmount=0 then
|
|
if FieldsAmount=0 then
|
|
DatabaseError(SNoIndexFieldNameGiven);
|
|
DatabaseError(SNoIndexFieldNameGiven);
|
|
SetLength(DBCompareStruct,FieldsAmount);
|
|
SetLength(DBCompareStruct,FieldsAmount);
|
|
@@ -474,12 +478,17 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
DBCompareStruct[FieldNr].Desc := (DescIndexFields.IndexOf(AField)>-1);
|
|
DBCompareStruct[FieldNr].Desc := (DescIndexFields.IndexOf(AField)>-1);
|
|
|
|
+ if (CInsIndexFields.IndexOf(AField)>-1) then
|
|
|
|
+ DBCompareStruct[FieldNr].Options := [loCaseInsensitive]
|
|
|
|
+ else
|
|
|
|
+ DBCompareStruct[FieldNr].Options := [];
|
|
|
|
|
|
DBCompareStruct[FieldNr].Off1:=sizeof(TBufRecLinkItem)*FMaxIndexesCount+FFieldBufPositions[AField.FieldNo-1];
|
|
DBCompareStruct[FieldNr].Off1:=sizeof(TBufRecLinkItem)*FMaxIndexesCount+FFieldBufPositions[AField.FieldNo-1];
|
|
DBCompareStruct[FieldNr].Off2:=DBCompareStruct[FieldNr].Off1;
|
|
DBCompareStruct[FieldNr].Off2:=DBCompareStruct[FieldNr].Off1;
|
|
|
|
|
|
end;
|
|
end;
|
|
finally
|
|
finally
|
|
|
|
+ CInsIndexFields.Free;
|
|
DescIndexFields.Free;
|
|
DescIndexFields.Free;
|
|
IndexFields.Free;
|
|
IndexFields.Free;
|
|
end;
|
|
end;
|