diff options
author | ivan <ivan> | 2007-02-08 22:19:56 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-02-08 22:19:56 +0000 |
commit | 1d15d22917b9e91fbb9b5a195f94bf3b71fe304a (patch) | |
tree | 8057c715c5a06a186ee2f5615e82e28e2ee8c688 | |
parent | 79f1e3f6d8172bbb4e85bc063f19ba0010c9253f (diff) |
use a LIMIT to retreive the first record, don't rely on qsearchs to trim it for you - it is inefficient and outputs long verbose warnings
-rw-r--r-- | FS/FS/cust_pkg.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index ea959ab11..b2ef2a259 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -693,7 +693,7 @@ sub last_reason { my $cust_pkg_reason = qsearchs( { 'table' => 'cust_pkg_reason', 'hashref' => { 'pkgnum' => $self->pkgnum, }, - 'extra_sql'=> 'ORDER BY date DESC', + 'extra_sql'=> 'ORDER BY date DESC LIMIT 1', } ); qsearchs ( 'reason', { 'reasonnum' => $cust_pkg_reason->reasonnum } ) if $cust_pkg_reason; |