Changeset 757 for trunk/cgi-bin
- Timestamp:
- 07/28/15 17:52:15 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r756 r757 2943 2943 if ($type eq 'i') { 2944 2944 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 = ? 2947 2950 ), undef, ($id) ); 2948 2951 return $binfo; 2949 2952 } else { 2950 2953 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, 2952 2955 f.cidr AS reserve, f.id as reserve_id, 2953 2956 d.zone >>= a.cidr AS revavail, d.zone << a.cidr AS revpartial 2954 2957 FROM allocations a 2955 2958 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) 2957 2960 WHERE a.id = ? 2958 2961 ), undef, ($id) );
Note:
See TracChangeset
for help on using the changeset viewer.