mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:09:25 +02:00
sqliteds: fix locate in float / datetime fields. Bug #20545. Patch by Ludo Brands
git-svn-id: trunk@19602 -
This commit is contained in:
parent
de2bd0d896
commit
f55bf0ff05
@ -1067,6 +1067,19 @@ begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function CompDouble(UTF8Value: PChar; const UTF8Key: String): Boolean;
|
||||
var e1,e2:double;
|
||||
begin
|
||||
if UTF8Value <> nil then
|
||||
begin
|
||||
val(UTF8Value,e1);
|
||||
val(UTF8Key,e2);
|
||||
result:=e1=e2;
|
||||
end
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function CompInsensitiveWild(UTF8Value: PChar; const AnsiKey: String): Boolean;
|
||||
begin
|
||||
//IsWild does not work with UTF8 encoded strings for case insensitive searches,
|
||||
@ -1153,7 +1166,7 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
LocateFields[i].CompFunction := @CompSensitive;
|
||||
LocateFields[i].CompFunction := @CompDouble;
|
||||
//get float types in appropriate format
|
||||
if VarIsArray(KeyValues) then
|
||||
Str(VarToDateTime(keyvalues[i]), AValue)
|
||||
|
Loading…
Reference in New Issue
Block a user