Don't use order and limit for count query. see #7415

git-svn-id: https://develop.svn.wordpress.org/trunk@10424 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-01-23 22:40:37 +00:00
parent f0734fb79c
commit b78c24845a
1 changed files with 3 additions and 4 deletions

View File

@ -1969,13 +1969,12 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
comment_author_IP LIKE ('%$s%') OR
comment_content LIKE ('%$s%') ) AND
$approved
$typesql
$orderby";
$typesql";
} else {
$query = "FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved $post $typesql $orderby";
$query = "FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved $post $typesql";
}
$comments = $wpdb->get_results("SELECT * $query");
$comments = $wpdb->get_results("SELECT * $query $orderby");
if ( '' === $total )
$total = $wpdb->get_var("SELECT COUNT(comment_ID) $query");