- Timestamp:
- 09/17/12 17:52:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r385 r386 2483 2483 ##fixme: put this whole sub in a transaction? might be 2484 2484 # needed for accurate results on very busy systems. 2485 my %gref; 2486 my $i = 0; 2485 ##fixme: large group lists need prepared statements? 2486 #my $ucsth = $dbh->prepare("SELECT count(*) FROM users WHERE group_id=?"); 2487 #my $dcsth = $dbh->prepare("SELECT count(*) FROM domains WHERE group_id=?"); 2488 #my $rcsth = $dbh->prepare("SELECT count(*) FROM revzones WHERE group_id=?"); 2487 2489 foreach (@{$glist}) { 2488 $gref{$$_{groupid}} = $i++; 2489 } 2490 my $tmpchlist = $args{curgroup}.($args{childlist} ? ",$args{childlist}" : ''); 2491 foreach my $grp (split /,/, $tmpchlist) { 2492 my ($ucnt) = $dbh->selectrow_array("SELECT count(*) FROM users WHERE group_id=?", undef, ($grp)); 2493 $glist->[$gref{$grp}]{nusers} = $ucnt; 2494 my ($dcnt) = $dbh->selectrow_array("SELECT count(*) FROM domains WHERE group_id=?", undef, ($grp)); 2495 $glist->[$gref{$grp}]{ndomains} = $dcnt; 2496 my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM revzones WHERE group_id=?", undef, ($grp)); 2497 $glist->[$gref{$grp}]{nrevzones} = $rcnt; 2490 my ($ucnt) = $dbh->selectrow_array("SELECT count(*) FROM users WHERE group_id=?", undef, ($$_{groupid})); 2491 $$_{nusers} = $ucnt; 2492 my ($dcnt) = $dbh->selectrow_array("SELECT count(*) FROM domains WHERE group_id=?", undef, ($$_{groupid})); 2493 $$_{ndomains} = $dcnt; 2494 my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM revzones WHERE group_id=?", undef, ($$_{groupid})); 2495 $$_{nrevzones} = $rcnt; 2498 2496 } 2499 2497
Note:
See TracChangeset
for help on using the changeset viewer.