mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:19:25 +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));
|
||||
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;
|
||||
|
||||
begin
|
||||
@ -1534,6 +1546,7 @@ procedure TCustomBufDataset.ProcessFieldCompareStruct(AField: TField; var ACompa
|
||||
begin
|
||||
case AField.DataType of
|
||||
ftString, ftFixedChar : ACompareRec.Comparefunc := @DBCompareText;
|
||||
ftWideString, ftFixedWideChar: ACompareRec.Comparefunc := @DBCompareWideText;
|
||||
ftSmallint : ACompareRec.Comparefunc := @DBCompareSmallInt;
|
||||
ftInteger, ftBCD, ftAutoInc : ACompareRec.Comparefunc :=
|
||||
@DBCompareInt;
|
||||
|
Loading…
Reference in New Issue
Block a user