summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2013-07-31 19:26:51 +0200
committerMichael Tänzer <neo@nhng.de>2013-07-31 19:26:51 +0200
commitea42d51aed5a3e3ec0e2a0d38983c24665a1d6d5 (patch)
treedd9db156cad15128603761e7717e3e04e1a5bfcf
parent56e830101351d98510a01a664a34951b2fef9af8 (diff)
downloadcacert-devel-ea42d51aed5a3e3ec0e2a0d38983c24665a1d6d5.tar.gz
cacert-devel-ea42d51aed5a3e3ec0e2a0d38983c24665a1d6d5.tar.xz
cacert-devel-ea42d51aed5a3e3ec0e2a0d38983c24665a1d6d5.zip
bug 893: Use optimised SQL query from bug #922
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/notary.inc.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 929158e..3de0b09 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -811,12 +811,15 @@
//called from www/diputes.php if($type == "reallydomain") / if($action == "accept")
//called from account_delete
$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` = '$id'
+ 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))
{