Changeset 384 for trunk


Ignore:
Timestamp:
08/13/12 17:29:21 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix bugs in new SQL bits in getDomRecs(). See #10.

  • Don't retrieve location on $def, not $rev
  • Use left join to pull in location, so that the presence or absence of a location on a record does not determine if it shows up in the record list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r383 r384  
    33023302
    33033303  my $sql = "SELECT r.record_id,r.host,r.type,r.val,r.ttl";
     3304  $sql .= ",l.description AS locname" if $def eq 'n';
    33043305  $sql .= ",r.distance,r.weight,r.port" if $rev eq 'n';
    33053306  $sql .= " FROM "._rectable($def,$rev)." r ";
    33063307  $sql .= "INNER JOIN rectypes t ON r.type=t.val ";     # for sorting by type alphabetically
     3308  $sql .= "LEFT JOIN locations l ON r.location=l.location " if $def eq 'n';
    33073309  $sql .= "WHERE "._recparent($def,$rev)." = ?";
    33083310  $sql .= " AND NOT r.type=$reverse_typemap{SOA}";
Note: See TracChangeset for help on using the changeset viewer.