diff options
author | Yorhel <git@yorhel.nl> | 2008-10-27 18:39:03 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-10-27 18:39:03 +0100 |
commit | 3499c666034942a162ed6d93726e43ff74f57ee6 (patch) | |
tree | 817899f1375c7c6ccc50d30d1211a0c24f37537c | |
parent | 0a22ed97765c4f8937abae863c36e094b2df217f (diff) |
YAWF::DB: Turned 'zero but true' into 'zero and false' for dbExec()
Because really, dbExec() can't return any false value otherwise, and
what you really want to do is to check whether any rows were affected
at all. Better to return a false value if nothing happens.
-rw-r--r-- | lib/YAWF/DB.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/YAWF/DB.pm b/lib/YAWF/DB.pm index a7f4586..314f45a 100644 --- a/lib/YAWF/DB.pm +++ b/lib/YAWF/DB.pm @@ -100,7 +100,7 @@ sub sqlhelper { # type, query, @list push(@{$self->{_YAWF}{DB}{queries}}, [ \@q, Time::HiRes::tv_interval($start) ]) if $self->debug; - $r = 0 if $type == 0 && !$r; + $r = 0 if $type == 0 && (!$r || $r == 0); $r = {} if $type == 1 && (!$r || ref($r) ne 'HASH'); $r = [] if $type == 2 && (!$r || ref($r) ne 'ARRAY'); |