fixed EXISTS

This commit is contained in:
Kenichi Ishigaki 2013-07-04 13:40:10 +09:00
parent a94bdc6ca2
commit 879640f4c5
2 changed files with 4 additions and 2 deletions

View file

@ -139,9 +139,9 @@ sub NEXTKEY {
sub EXISTS {
my ($self, $key) = @_;
$self->[1]->kv_fetch($key);
$self->[1]->kv_fetch($key) and return 1;
my $errstr = $self->[1]->errstr;
return $errstr eq 'UNQLITE_NOTFOUND' ? 1 : 0;
return $errstr && $errstr eq 'UNQLITE_OK' ? 1 : 0;
}
sub CLEAR {