Changeset 104 for trunk


Ignore:
Timestamp:
07/15/11 15:41:54 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak getDomRecs() to "correctly" sort domain records on type

(alphabetic instead of DNS RR type number)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r103 r104  
    10611061  $sql .= "default_" if $type eq 'y';
    10621062  $sql .= "records r ";
     1063  $sql .= "INNER JOIN rectypes t ON r.type=t.val ";     # for sorting by type alphabetically
    10631064  $sql .= "LEFT OUTER JOIN longrecs l ON r.longrec_id=l.longrec_id ";
    10641065  if ($type eq 'y') {
     
    10671068    $sql .= "WHERE r.domain_id=?";
    10681069  }
    1069   $sql .= " AND NOT r.type=$reverse_typemap{SOA} ORDER BY r.$order $direction";
     1070  $sql .= " AND NOT r.type=$reverse_typemap{SOA}";
     1071  # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number
     1072  $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")." $direction";
    10701073  $sql .= " LIMIT $nrecs OFFSET ".($nstart*$nrecs) if $nstart ne 'all';
    10711074
Note: See TracChangeset for help on using the changeset viewer.