Changeset 422 for branches/stable/DNSDB.pm
- Timestamp:
- 10/10/12 13:41:00 (12 years ago)
- Location:
- branches/stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable
-
branches/stable/DNSDB.pm
r419 r422 32 32 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 33 33 34 $VERSION = 1.0. 2; ##VERSION##34 $VERSION = 1.0.3; ##VERSION## 35 35 @ISA = qw(Exporter); 36 36 @EXPORT_OK = qw( … … 1315 1315 $sql .= "default_" if $type eq 'y'; 1316 1316 $sql .= "records r "; 1317 1318 # whee! multisort means just passing comma-separated fields in sortby! 1319 my $newsort = ''; 1320 foreach my $sf (split /,/, $order) { 1321 $sf = "r.$sf"; 1322 $sf =~ s/r\.type/t.alphaorder/; 1323 $newsort .= ",$sf"; 1324 } 1325 $newsort =~ s/^,//; 1326 1317 1327 $sql .= "INNER JOIN rectypes t ON r.type=t.val "; # for sorting by type alphabetically 1318 1328 if ($type eq 'y') { … … 1324 1334 $sql .= " AND host ~* ?" if $filter; 1325 1335 # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number 1326 $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")."$direction";1336 $sql .= " ORDER BY $newsort $direction"; 1327 1337 $sql .= " LIMIT $nrecs OFFSET ".($nstart*$nrecs) if $nstart ne 'all'; 1328 1338
Note:
See TracChangeset
for help on using the changeset viewer.