Changeset 186
- Timestamp:
- 12/06/11 13:51:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r185 r186 1499 1499 return 0 if $type1 eq 'domain' && $type2 ne 'record'; # domain may not be a parent of anything other than a record 1500 1500 1501 # ennnhhhh.... if we're passed an id of 0, it will never be found. usual 1502 # case would be the UI creating a new <thing>, and so we don't have an ID for 1503 # <thing> to look up yet. in that case the UI should check the parent as well. 1504 # argument for returning 1 is 1505 return 0 if $id1 == 0; # nothing can have a parent id of 0 1506 return 1 if $id2 == 0; # anything could have a child id of 0 (or "unknown") 1507 1501 1508 # group 1 is the ultimate root parent 1502 1509 return 1 if $type1 eq 'group' && $id1 == 1; … … 1510 1517 my $foundparent = 0; 1511 1518 1519 my $limiter = 0; 1512 1520 while (1) { 1513 1521 my $sql = "SELECT $par_col{$type} FROM $par_tbl{$type} WHERE $id_col{$type} = ?"; 1514 1522 my $result = $dbh->selectrow_hashref($sql, 1515 1523 undef, ($id) ); 1524 if (!$result) { 1525 $limiter++; 1526 ##fixme: how often will this happen on a live site? 1527 warn "no results looking for $sql with id $id (depth $limiter)\n"; 1528 last; 1529 } 1516 1530 if ($result && $result->{$par_col{$type}} == $id1) { 1517 1531 $foundparent = 1;
Note:
See TracChangeset
for help on using the changeset viewer.