Changeset 757 for trunk/cgi-bin


Ignore:
Timestamp:
07/28/15 17:52:15 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine "rDNS-is-available?" flags and how they're generated in
getBlockData(). See #41.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r756 r757  
    29432943  if ($type eq 'i') {
    29442944    my $binfo = $dbh->selectrow_hashref(qq(
    2945         SELECT id, ip AS block, city, vrf, parent_id, master_id, $commonfields
    2946         FROM poolips WHERE id = ?
     2945        SELECT p.id, p.ip AS block, p.city, p.vrf, p.parent_id, p.master_id, $commonfields,
     2946                d.zone >> p.ip AS revavail
     2947        FROM poolips p
     2948        LEFT JOIN dnsavail d ON p.master_id = d.parent_alloc AND p.ip << d.zone
     2949        WHERE id = ?
    29472950        ), undef, ($id) );
    29482951    return $binfo;
    29492952  } else {
    29502953    my $binfo = $dbh->selectrow_hashref(qq(
    2951         SELECT a.id, a.cidr AS block, a.city, a.vrf, a.parent_id, a.master_id, swip, revzone, $commonfields,
     2954        SELECT a.id, a.cidr AS block, a.city, a.vrf, a.parent_id, a.master_id, swip, $commonfields,
    29522955                f.cidr AS reserve, f.id as reserve_id,
    29532956                d.zone >>= a.cidr AS revavail, d.zone << a.cidr AS revpartial
    29542957        FROM allocations a
    29552958        LEFT JOIN freeblocks f ON a.id=f.reserve_for
    2956         LEFT JOIN dnsavail d ON a.parent_id = d.parent_alloc AND (a.cidr <<= d.zone OR a.cidr >> d.zone)
     2959        LEFT JOIN dnsavail d ON a.master_id = d.parent_alloc AND (a.cidr <<= d.zone OR a.cidr >> d.zone)
    29572960        WHERE a.id = ?
    29582961        ), undef, ($id) );
Note: See TracChangeset for help on using the changeset viewer.