Date: | Tue, 23 Dec 2003 15:40:39 +1100 |
From: | Angus Lees <angus.lees [...] urnet.com.au> |
To: | rt-devel [...] lists.fsck.com |
Subject: | [patch] DBIx::SearchBuilder warning avoidance |
This patch avoids some warnings about uninitialised values during our
rt2-to-rt3 import. I haven't explored why these values were undef
where they perhaps shouldn't have been, but the patch shouldn't change
any behaviour.
--- /tmp/Pg.pm 2003-12-23 15:34:47.000000000 +1100
+++ libdbix-searchbuilder-perl-0.94/SearchBuilder/Handle/Pg.pm 2003-11-16 11:07:16.000000000 +1100
@@ -102,8 +102,8 @@
if ( $per_page) {
$limit_clause = " LIMIT ";
$limit_clause .= $per_page;
- if ( $first != 0 ) {
+ if ( $first ) {
$limit_clause .= " OFFSET $first";
}
}
--- /tmp/Cachable.pm 2003-12-23 15:34:47.000000000 +1100
+++ libdbix-searchbuilder-perl-0.94/SearchBuilder/Record/Cachable.pm 2003-11-16 11:07:16.000000000 +1100
@@ -89,7 +89,7 @@
my $cache_key = $this->_lookup_primary_cache_key($alternate_key);
- if ($cache_key && exists $this->_RecordCache->{$cache_key}) {
+ if ($cache_key && defined $this->_RecordCache->{$cache_key}{'time'}) {
$cache_time = $this->_RecordCache->{$cache_key}{'time'};
## Decide if the cache object is too old
--
- Gus