From b78c24845ab4ccba5bcb076bdcd9bb1436c9cab3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 23 Jan 2009 22:40:37 +0000 Subject: [PATCH] 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 --- wp-admin/includes/template.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index c517f2c848..c9bcfb4420 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -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");