Changeset 352
- Timestamp:
- 06/27/12 17:07:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r350 r352 3039 3039 my $filter = shift || ''; 3040 3040 3041 # sort reverse zones on IP, correctly 3042 # do other fiddling with $order while we're at it. 3043 $order = "r.$order"; 3044 $order = 'CAST (r.val AS inet)' if $rev eq 'y' && $order eq 'r.val'; 3045 $order = 't.alphaorder' if $order eq 'r.type'; 3046 3041 3047 my $sql = "SELECT r.record_id,r.host,r.type,r.val,r.ttl"; 3042 3048 $sql .= ",r.distance,r.weight,r.port" if $rev eq 'n'; … … 3047 3053 $sql .= " AND host ~* ?" if $filter; 3048 3054 # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number 3049 $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")."$direction";3055 $sql .= " ORDER BY $order $direction"; 3050 3056 # ensure consistent ordering by sorting on record_id too 3051 3057 $sql .= ", record_id $direction";
Note:
See TracChangeset
for help on using the changeset viewer.