Changeset 599 for trunk/DNSDB.pm
- Timestamp:
- 03/21/14 16:44:13 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r597 r599 3667 3667 foreach my $sf (split /,/, $args{sortby}) { 3668 3668 $sf = "r.$sf"; 3669 $sf =~ s/r\.val/ CAST (r.val AS inet)/3669 $sf =~ s/r\.val/inetlazy(r.val)/ 3670 3670 if $args{revrec} eq 'y' && $args{defrec} eq 'n'; 3671 3671 $sf =~ s/r\.type/t.alphaorder/; … … 4341 4341 ##fixme? may need to narrow things down more by octet-chopping and doing text comparisons before casting. 4342 4342 my ($revpatt) = $dbh->selectrow_array("SELECT host FROM records ". 4343 "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND CAST (val AS inet) >>= ? ".4344 "ORDER BY CAST (val AS inet) DESC LIMIT 1", undef, ($revid, $cidr) );4343 "WHERE (type in (12,65280,65281,65282,65283,65284)) AND rdns_id = ? AND inetlazy(val) >>= ? ". 4344 "ORDER BY inetlazy(val) DESC LIMIT 1", undef, ($revid, $cidr) ); 4345 4345 return $revpatt; 4346 4346 } # end getRevPattern() … … 5164 5164 my $recsth = $dbh->prepare("SELECT host,type,val,distance,weight,port,ttl,record_id,location,extract(epoch from stamp),expires,stampactive ". 5165 5165 "FROM records WHERE rdns_id=? AND NOT type=6 ". 5166 "ORDER BY masklen( CAST(val AS inet)) DESC, CAST(val AS inet)");5166 "ORDER BY masklen(inetlazy(val)) DESC, inetlazy(val)"); 5167 5167 my $revsth = $dbh->prepare("SELECT rdns_id,revnet,status,changed FROM revzones WHERE status=1 ". 5168 5168 "ORDER BY masklen(revnet) DESC, rdns_id");
Note:
See TracChangeset
for help on using the changeset viewer.