mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-23 16:51:32 +01:00
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:
parent
4b3d6012aa
commit
cd3286b018
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user