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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-01-23 22:40:37 +00:00
parent 4b3d6012aa
commit cd3286b018

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");