mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 10:29:29 +02:00
fcl-db: bufdataset: remove unneeded fields of TDBCompareRec
git-svn-id: trunk@27587 -
This commit is contained in:
parent
1d2c56255e
commit
88bea93d60
@ -104,11 +104,9 @@ type
|
|||||||
|
|
||||||
TDBCompareRec = record
|
TDBCompareRec = record
|
||||||
CompareFunc : TCompareFunc;
|
CompareFunc : TCompareFunc;
|
||||||
Off1,Off2 : PtrInt;
|
Off : PtrInt;
|
||||||
FieldInd1,
|
NullBOff : PtrInt;
|
||||||
FieldInd2 : longint;
|
FieldInd : longint;
|
||||||
NullBOff1,
|
|
||||||
NullBOff2 : PtrInt;
|
|
||||||
Size : integer;
|
Size : integer;
|
||||||
Options : TLocateOptions;
|
Options : TLocateOptions;
|
||||||
Desc : Boolean;
|
Desc : Boolean;
|
||||||
@ -815,8 +813,8 @@ 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
|
||||||
IsNull1:=GetFieldIsNull(rec1+NullBOff1,FieldInd1);
|
IsNull1:=GetFieldIsNull(rec1+NullBOff,FieldInd);
|
||||||
IsNull2:=GetFieldIsNull(rec2+NullBOff2,FieldInd2);
|
IsNull2:=GetFieldIsNull(rec2+NullBOff,FieldInd);
|
||||||
if IsNull1 and IsNull2 then
|
if IsNull1 and IsNull2 then
|
||||||
Result := 0
|
Result := 0
|
||||||
else if IsNull1 then
|
else if IsNull1 then
|
||||||
@ -824,7 +822,7 @@ begin
|
|||||||
else if IsNull2 then
|
else if IsNull2 then
|
||||||
Result := 1
|
Result := 1
|
||||||
else
|
else
|
||||||
Result := CompareFunc(Rec1+Off1, Rec2+Off2, Size, Options);
|
Result := CompareFunc(Rec1+Off, Rec2+Off, Size, Options);
|
||||||
|
|
||||||
if Result <> 0 then
|
if Result <> 0 then
|
||||||
begin
|
begin
|
||||||
@ -1781,16 +1779,11 @@ begin
|
|||||||
DatabaseErrorFmt(SErrIndexBasedOnInvField, [AField.FieldName,Fieldtypenames[AField.DataType]]);
|
DatabaseErrorFmt(SErrIndexBasedOnInvField, [AField.FieldName,Fieldtypenames[AField.DataType]]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ACompareRec.Off1:=BufferOffset + FFieldBufPositions[AField.FieldNo-1];
|
ACompareRec.Off:=BufferOffset + FFieldBufPositions[AField.FieldNo-1];
|
||||||
ACompareRec.Off2:=ACompareRec.Off1;
|
ACompareRec.NullBOff:=BufferOffset;
|
||||||
|
|
||||||
ACompareRec.FieldInd1:=AField.FieldNo-1;
|
ACompareRec.FieldInd:=AField.FieldNo-1;
|
||||||
ACompareRec.FieldInd2:=ACompareRec.FieldInd1;
|
ACompareRec.Size:=GetFieldSize(FieldDefs[ACompareRec.FieldInd]);
|
||||||
|
|
||||||
ACompareRec.Size:=GetFieldSize(FieldDefs[ACompareRec.FieldInd1]);
|
|
||||||
|
|
||||||
ACompareRec.NullBOff1:=BufferOffset;
|
|
||||||
ACompareRec.NullBOff2:=ACompareRec.NullBOff1;
|
|
||||||
|
|
||||||
ACompareRec.Desc := ixDescending in AIndexOptions;
|
ACompareRec.Desc := ixDescending in AIndexOptions;
|
||||||
if assigned(ADescFields) then
|
if assigned(ADescFields) then
|
||||||
|
Loading…
Reference in New Issue
Block a user