- Timestamp:
- 12/28/12 16:52:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r578 r579 485 485 486 486 # do it this way so we can waste a little less time iterating 487 my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? AND vrf = ? ". 487 # my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? AND vrf = ? ". 488 my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? ". 488 489 "ORDER BY cidr"); 489 $sth->execute($args{master}, $args{rdepth}, $args{vrf}); 490 # $sth->execute($args{master}, $args{rdepth}, $args{vrf}); 491 $sth->execute($args{master}, $args{rdepth}); 490 492 my @flist; 491 493 while (my ($cidr) = $sth->fetchrow_array()) { … … 1059 1061 return ('FAIL', 'No fields to update') if !@fieldlist; 1060 1062 1061 push @vallist, $args{block}, $args{rdepth}, $args{vrf}; 1063 # push @vallist, $args{block}, $args{rdepth}, $args{vrf}; 1064 push @vallist, $args{block}, $args{rdepth}; 1062 1065 my $sql = "UPDATE $updtable SET "; 1063 1066 $sql .= join " = ?, ", @fieldlist; 1064 $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? AND vrf = ?"; 1067 # $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? AND vrf = ?"; 1068 $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? "; 1065 1069 1066 1070 eval { … … 1363 1367 my $binfo = $dbh->selectrow_hashref("SELECT cidr AS block, 'mm' AS type, 0 AS parent, cidr,". 1364 1368 " ctime, mtime, rwhois, vrf". 1365 " FROM masterblocks WHERE cidr = ? AND vrf = ?", undef, ($block, $vrf) ); 1369 " FROM masterblocks WHERE cidr = ?", undef, ($block) ); 1370 # " FROM masterblocks WHERE cidr = ? AND vrf = ?", undef, ($block, $vrf) ); 1366 1371 return $binfo; 1367 1372 } elsif ($btype =~ /^.i$/) { 1368 1373 my $binfo = $dbh->selectrow_hashref("SELECT ip AS block, custid, type, city, circuitid, description,". 1369 1374 " notes, modifystamp AS lastmod, privdata, vrf, pool, rdepth". 1370 " FROM poolips WHERE ip = ? AND vrf = ?", undef, ($block, $vrf) ); 1375 " FROM poolips WHERE ip = ?", undef, ($block) ); 1376 # " FROM poolips WHERE ip = ? AND vrf = ?", undef, ($block, $vrf) ); 1371 1377 return $binfo; 1372 1378 } else {
Note:
See TracChangeset
for help on using the changeset viewer.