mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 19:39:20 +02:00
* Lookup should return an empty variant instead of false in case of failure (+test)
git-svn-id: trunk@12538 -
This commit is contained in:
parent
2295667674
commit
9abc13aff1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7672,6 +7672,7 @@ tests/test/packages/fcl-db/tdb1.pp svneol=native#text/plain
|
|||||||
tests/test/packages/fcl-db/tdb2.pp svneol=native#text/plain
|
tests/test/packages/fcl-db/tdb2.pp svneol=native#text/plain
|
||||||
tests/test/packages/fcl-db/tdb3.pp svneol=native#text/plain
|
tests/test/packages/fcl-db/tdb3.pp svneol=native#text/plain
|
||||||
tests/test/packages/fcl-db/tdb4.pp svneol=native#text/plain
|
tests/test/packages/fcl-db/tdb4.pp svneol=native#text/plain
|
||||||
|
tests/test/packages/fcl-db/tdb5.pp svneol=native#text/plain
|
||||||
tests/test/packages/fcl-db/toolsunit.pas svneol=native#text/plain
|
tests/test/packages/fcl-db/toolsunit.pas svneol=native#text/plain
|
||||||
tests/test/packages/fcl-registry/tregistry1.pp svneol=native#text/plain
|
tests/test/packages/fcl-registry/tregistry1.pp svneol=native#text/plain
|
||||||
tests/test/packages/hash/tmdtest.pp svneol=native#text/plain
|
tests/test/packages/hash/tmdtest.pp svneol=native#text/plain
|
||||||
|
@ -2294,7 +2294,7 @@ Function TDataset.Lookup(const KeyFields: string; const KeyValues: Variant; cons
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
CheckBiDirectional;
|
CheckBiDirectional;
|
||||||
Result := False;
|
Result := Null;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
20
tests/test/packages/fcl-db/tdb5.pp
Normal file
20
tests/test/packages/fcl-db/tdb5.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
program LookupIsNull;
|
||||||
|
|
||||||
|
uses db, memds, variants;
|
||||||
|
|
||||||
|
var
|
||||||
|
DSet:TMemDataset;
|
||||||
|
tmpVariant:Variant;
|
||||||
|
|
||||||
|
begin
|
||||||
|
DSet:=TMemDataset.Create(nil);
|
||||||
|
DSet.FieldDefs.Add('NAME',ftString,20);
|
||||||
|
DSet.CreateTable;
|
||||||
|
DSet.Open;
|
||||||
|
|
||||||
|
tmpVariant:=DSet.Lookup('NAME','aaaa','NAME');
|
||||||
|
if not (VarIsNull(tmpVariant)) then
|
||||||
|
Halt(1);
|
||||||
|
DSet.Close;
|
||||||
|
DSet.Free;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user