mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 12:29:32 +02:00
* FCL-DB: only honour lopartialkey for locate on indexed fields if field is string type.
This aligns behaviour with non-indexed locate as well as fpc bufdataset. Partly addresses issue #23509 git-svn-id: trunk@23190 -
This commit is contained in:
parent
9f60eca94f
commit
4556129de7
@ -1758,7 +1758,7 @@ var
|
||||
var
|
||||
sCompare: String;
|
||||
begin
|
||||
if (Field.DataType = ftString) then
|
||||
if (Field.DataType in [ftString,ftWideString]) then
|
||||
begin
|
||||
sCompare := VarToStr(varCompare);
|
||||
if loCaseInsensitive in Options then
|
||||
@ -1785,6 +1785,8 @@ var
|
||||
end;
|
||||
end
|
||||
else
|
||||
// Not a string; could be date, integer etc.
|
||||
// Follow e.g. FPC bufdataset by searching for equal
|
||||
Result := Field.Value = varCompare;
|
||||
end;
|
||||
|
||||
@ -1848,7 +1850,9 @@ var
|
||||
lTempBuffer: array [0..100] of Char;
|
||||
acceptable, checkmatch: boolean;
|
||||
begin
|
||||
if loPartialKey in Options then
|
||||
// Only honor loPartialKey for string types; for others, search for equal
|
||||
if (loPartialKey in Options) and
|
||||
(TIndexCursor(FCursor).IndexFile.KeyType='C') then
|
||||
searchFlag := stGreaterEqual
|
||||
else
|
||||
searchFlag := stEqual;
|
||||
|
Loading…
Reference in New Issue
Block a user