* Lookup should return an empty variant instead of false in case of failure (+test)

git-svn-id: trunk@12538 -
This commit is contained in:
joost 2009-01-11 13:41:46 +00:00
parent 2295667674
commit 9abc13aff1
3 changed files with 22 additions and 1 deletions

1
.gitattributes vendored
View File

@ -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/tdb3.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-registry/tregistry1.pp svneol=native#text/plain
tests/test/packages/hash/tmdtest.pp svneol=native#text/plain

View File

@ -2294,7 +2294,7 @@ Function TDataset.Lookup(const KeyFields: string; const KeyValues: Variant; cons
begin
CheckBiDirectional;
Result := False;
Result := Null;
end;

View 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.