mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:49:13 +02:00
* add some wide* cases to bufdataset index building, fixes bug #19807
git-svn-id: trunk@18022 -
This commit is contained in:
parent
eef37e69c5
commit
e7375bf76f
@ -625,6 +625,18 @@ begin
|
|||||||
Result := AnsiCompareStr(pchar(subValue),pchar(aValue));
|
Result := AnsiCompareStr(pchar(subValue),pchar(aValue));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function DBCompareWideText(subValue, aValue: pointer; options: TLocateOptions): LargeInt;
|
||||||
|
begin
|
||||||
|
if [loCaseInsensitive,loPartialKey]=options then
|
||||||
|
Result := WideCompareText(pwidechar(subValue),LeftStr(pwidechar(aValue), Length(pwidechar(subValue))))
|
||||||
|
else if [loPartialKey] = options then
|
||||||
|
Result := WideCompareStr(pwidechar(subValue),LeftStr(pwidechar(aValue), Length(pwidechar(subValue))))
|
||||||
|
else if [loCaseInsensitive] = options then
|
||||||
|
Result := WideCompareText(pwidechar(subValue),pwidechar(aValue))
|
||||||
|
else
|
||||||
|
Result := WideCompareStr(pwidechar(subValue),pwidechar(aValue));
|
||||||
|
end;
|
||||||
|
|
||||||
function DBCompareByte(subValue, aValue: pointer; options: TLocateOptions): LargeInt;
|
function DBCompareByte(subValue, aValue: pointer; options: TLocateOptions): LargeInt;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -1534,6 +1546,7 @@ procedure TCustomBufDataset.ProcessFieldCompareStruct(AField: TField; var ACompa
|
|||||||
begin
|
begin
|
||||||
case AField.DataType of
|
case AField.DataType of
|
||||||
ftString, ftFixedChar : ACompareRec.Comparefunc := @DBCompareText;
|
ftString, ftFixedChar : ACompareRec.Comparefunc := @DBCompareText;
|
||||||
|
ftWideString, ftFixedWideChar: ACompareRec.Comparefunc := @DBCompareWideText;
|
||||||
ftSmallint : ACompareRec.Comparefunc := @DBCompareSmallInt;
|
ftSmallint : ACompareRec.Comparefunc := @DBCompareSmallInt;
|
||||||
ftInteger, ftBCD, ftAutoInc : ACompareRec.Comparefunc :=
|
ftInteger, ftBCD, ftAutoInc : ACompareRec.Comparefunc :=
|
||||||
@DBCompareInt;
|
@DBCompareInt;
|
||||||
|
Loading…
Reference in New Issue
Block a user