diff options
author | Michael Tänzer <neo@nhng.de> | 2013-08-06 23:37:06 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2013-08-06 23:58:06 +0200 |
commit | 6744dcf1b1ce1da56498d25e837ceebc693a0bc1 (patch) | |
tree | 53dfb297896d6cb7367011489cf97eb202d10d1a | |
parent | 0a982f8ba01b5b47230d7a16aaa624bb9e340207 (diff) | |
download | cacert-devel-6744dcf1b1ce1da56498d25e837ceebc693a0bc1.tar.gz cacert-devel-6744dcf1b1ce1da56498d25e837ceebc693a0bc1.tar.xz cacert-devel-6744dcf1b1ce1da56498d25e837ceebc693a0bc1.zip |
bug 1136: Use optimised SQL query from bug #922
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r-- | includes/notary.inc.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 1ca6ba1..5fd64f1 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -1005,12 +1005,15 @@ function revoke_all_server_cert($domainid){ //revokes all server certs for an domain $domainid = intval($domainid); - $query = "select distinct `domaincerts`.`id` - from `domaincerts`, `domlink` - where `domaincerts`.`domid` = '$domainid' - or ( - `domaincerts`.`id` = `domlink`.`certid` - and `domlink`.`domid` = '$domainid')"; + $query = + "select `domaincerts`.`id` + from `domaincerts` + where `domaincerts`.`domid` = '$domainid' + union distinct + select `domaincerts`.`id` + from `domaincerts`, `domlink` + where `domaincerts`.`id` = `domlink`.`certid` + and `domlink`.`domid` = '$domainid'"; $dres = mysql_query($query); while($drow = mysql_fetch_assoc($dres)) { |