summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-03-03 10:25:22 +0000
committerivan <ivan>2005-03-03 10:25:22 +0000
commit8f11e2a03067829dc5f8cd6ae7fa0e3f249d61c1 (patch)
tree093dba96581d2774dba658ebd4fe3a27ffa88c58 /FS
parenta1e71c875ad297e0ab11de5c595b937b2e498f84 (diff)
clean up some harmless but scary "Multiple records in scalar search" warnings w/history table searches
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/h_Common.pm14
-rw-r--r--FS/FS/h_cust_svc.pm2
-rw-r--r--FS/FS/h_domain_record.pm33
-rw-r--r--FS/FS/h_svc_acct.pm2
-rw-r--r--FS/FS/h_svc_forward.pm4
-rw-r--r--FS/FS/h_svc_www.pm2
-rw-r--r--FS/MANIFEST2
-rw-r--r--FS/t/h_domain_record.t5
8 files changed, 59 insertions, 5 deletions
diff --git a/FS/FS/h_Common.pm b/FS/FS/h_Common.pm
index 58ead88e4..a7bb937e5 100644
--- a/FS/FS/h_Common.pm
+++ b/FS/FS/h_Common.pm
@@ -69,6 +69,20 @@ sub sql_h_search {
}
+=item sql_h_searchs END_TIMESTAMP [ START_TIMESTAMP ]
+
+Like sql_h_search, but limited to the single most recent record (before
+END_TIMESTAMP)
+
+=cut
+
+sub sql_h_searchs {
+ my $self = shift;
+ my($select, $where, $cacheobj, $as) = $self->sql_h_search(@_);
+ $where .= ' LIMIT 1';
+ ($select, $where, $cacheobj, $as);
+}
+
=back
=head1 BUGS
diff --git a/FS/FS/h_cust_svc.pm b/FS/FS/h_cust_svc.pm
index 9ef60fdc2..17be97d62 100644
--- a/FS/FS/h_cust_svc.pm
+++ b/FS/FS/h_cust_svc.pm
@@ -64,7 +64,7 @@ sub h_svc_x {
require "FS/h_$svcdb.pm";
qsearchs( "h_$svcdb",
{ 'svcnum' => $self->svcnum, },
- "FS::h_$svcdb"->sql_h_search(@_),
+ "FS::h_$svcdb"->sql_h_searchs(@_),
);
#}
}
diff --git a/FS/FS/h_domain_record.pm b/FS/FS/h_domain_record.pm
new file mode 100644
index 000000000..0ab974fe2
--- /dev/null
+++ b/FS/FS/h_domain_record.pm
@@ -0,0 +1,33 @@
+package FS::h_domain_record;
+
+use strict;
+use vars qw( @ISA );
+use FS::h_Common;
+use FS::domain_record;
+
+@ISA = qw( FS::h_Common FS::domain_record );
+
+sub table { 'h_domain_record' };
+
+=head1 NAME
+
+FS::h_domain_record - Historical DNS entry objects
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+An FS::h_domain_record object represents a historical entry in a DNS zone.
+FS::h_domain_record inherits from FS::h_Common and FS::domain_record.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::h_Common>, L<FS::svc_external>, L<FS::Record>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/h_svc_acct.pm b/FS/FS/h_svc_acct.pm
index cd98dd40e..95c5c413a 100644
--- a/FS/FS/h_svc_acct.pm
+++ b/FS/FS/h_svc_acct.pm
@@ -29,7 +29,7 @@ sub svc_domain {
my $self = shift;
qsearchs( 'h_svc_domain',
{ 'svcnum' => $self->domsvc },
- FS::h_svc_domain->sql_h_search(@_),
+ FS::h_svc_domain->sql_h_searchs(@_),
);
}
diff --git a/FS/FS/h_svc_forward.pm b/FS/FS/h_svc_forward.pm
index 231f9dfae..a43681540 100644
--- a/FS/FS/h_svc_forward.pm
+++ b/FS/FS/h_svc_forward.pm
@@ -29,7 +29,7 @@ sub srcsvc_acct {
my $self = shift;
qsearchs( 'h_svc_acct',
{ 'svcnum' => $self->srcsvc },
- FS::h_svc_acct->sql_h_search(@_),
+ FS::h_svc_acct->sql_h_searchs(@_),
);
}
@@ -41,7 +41,7 @@ sub dstsvc_acct {
my $self = shift;
qsearchs( 'h_svc_acct',
{ 'svcnum' => $self->dstsvc },
- FS::h_svc_acct->sql_h_search(@_),
+ FS::h_svc_acct->sql_h_searchs(@_),
);
}
diff --git a/FS/FS/h_svc_www.pm b/FS/FS/h_svc_www.pm
index f2f8af820..c6f347dac 100644
--- a/FS/FS/h_svc_www.pm
+++ b/FS/FS/h_svc_www.pm
@@ -29,7 +29,7 @@ sub domain_record {
my $self = shift;
qsearchs( 'h_domain_record',
{ 'recnum' => $self->recnum },
- FS::h_domain_record->sql_h_search(@_),
+ FS::h_domain_record->sql_h_searchs(@_),
);
}
diff --git a/FS/MANIFEST b/FS/MANIFEST
index 921bbc91b..9916fedd3 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -64,6 +64,7 @@ FS/cust_credit_refund.pm
FS/cust_svc.pm
FS/h_Common.pm
FS/h_cust_svc.pm
+FS/h_domain_record.pm
FS/h_svc_acct.pm
FS/h_svc_broadband.pm
FS/h_svc_domain.pm
@@ -185,6 +186,7 @@ t/cust_svc.t
t/h_cust_svc.t
t/h_Common.t
t/h_cust_svc.t
+t/h_domain_record.t
t/h_svc_acct.t
t/h_svc_broadband.t
t/h_svc_domain.t
diff --git a/FS/t/h_domain_record.t b/FS/t/h_domain_record.t
new file mode 100644
index 000000000..f48e72e9b
--- /dev/null
+++ b/FS/t/h_domain_record.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::h_domain_record;
+$loaded=1;
+print "ok 1\n";