Changeset 701 for trunk


Ignore:
Timestamp:
12/30/15 17:24:35 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Update back end getRevPatt() and getRevSet() which should have been
included in r700

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r699 r701  
    48294829  my $dbh = $self->{dbh};
    48304830  my $cidr = shift;
    4831   my $group = shift || 1;       # just in case
     4831  my %args = @_;
     4832  $args{group} = 1 if !$args{group};    # just in case
     4833  $args{location} = '' if !$args{location};
    48324834
    48334835  # for speed!  Casting and comparing even ~7K records takes ~2.5s, so narrow it down to one revzone first.
     
    48374839##fixme?  may need to narrow things down more by octet-chopping and doing text comparisons before casting.
    48384840  my ($revpatt) = $dbh->selectrow_array("SELECT host FROM records ".
    4839         "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND inetlazy(val) >>= ? ".
    4840         "ORDER BY inetlazy(val) DESC LIMIT 1", undef, ($revid, $cidr) );
     4841        "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? ".
     4842        "AND location = ? AND inetlazy(val) >>= ? ".
     4843        "ORDER BY inetlazy(val) DESC LIMIT 1",
     4844        undef, ($revid, $args{location}, $cidr) );
     4845
    48414846  return $revpatt;
    48424847} # end getRevPattern()
     
    48504855  my $dbh = $self->{dbh};
    48514856  my $cidr = shift;
    4852   my $group = shift || 1;       # just in case
     4857  my %args = @_;
     4858  $args{group} = 1 if !$args{group};    # just in case
     4859  $args{location} = '' if !$args{location};
    48534860
    48544861  # for speed!  Casting and comparing even ~7K records takes ~2.5s, so narrow it down to one revzone first.
     
    48664873
    48674874  my $sth = $dbh->prepare("SELECT val, host FROM records ".
    4868         "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND inetlazy(val) = ?");
     4875        "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND location = ? AND inetlazy(val) = ?");
    48694876
    48704877  my @ret;
    48714878  foreach my $ip (@{$cidr->splitref()}) {
    4872     $sth->execute($revid, $ip);
     4879    $sth->execute($revid, $args{location}, $ip);
    48734880    my @data = $sth->fetchrow_array();
    48744881    my %row;
Note: See TracChangeset for help on using the changeset viewer.