Changeset 462
- Timestamp:
- 02/27/13 17:20:18 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r459 r462 1304 1304 push @{$config{rpcacl}{$rpcsys}}, @ips; 1305 1305 } 1306 $config{rpcmode} = $1 if /^rpc_mode\s*=\s*(socket|HTTP|XMLRPC)\s*$/i; 1306 1307 } 1307 1308 } … … 3990 3991 my $group = shift || 1; # just in case 3991 3992 3992 my ($revpatt) = $dbh->selectrow_array("SELECT r.host FROM records r JOIN revzones z ON r.rdns_id=z.rdns_id ". 3993 "WHERE (r.type in (12,65280,65281,65282,65283,65284)) AND z.group_id=? AND CAST (r.val AS inet) >>= ? ". 3994 "ORDER BY CAST (r.val AS inet) DESC LIMIT 1", undef, ($group, $cidr) ); 3993 # for speed! Casting and comparing even ~7K records takes ~2.5s, so narrow it down to one revzone first. 3994 my ($revid) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >>= ? AND group_id = ?", 3995 undef, ($cidr, $group) ); 3996 3997 ##fixme? may need to narrow things down more by octet-chopping and doing text comparisons before casting. 3998 my ($revpatt) = $dbh->selectrow_array("SELECT host FROM records ". 3999 "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND CAST (val AS inet) >>= ? ". 4000 "ORDER BY CAST (val AS inet) DESC LIMIT 1", undef, ($revid, $cidr) ); 3995 4001 return $revpatt; 3996 4002 } # end getRevPattern()
Note:
See TracChangeset
for help on using the changeset viewer.