Make WordPress Core

Changeset 10424


Ignore:
Timestamp:
01/23/2009 10:40:37 PM (15 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r10422 r10424  
    19701970            comment_content LIKE ('%$s%') ) AND
    19711971            $approved
    1972             $typesql
    1973             $orderby";
     1972            $typesql";
    19741973    } else {
    1975         $query = "FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved $post $typesql $orderby";
    1976     }
    1977 
    1978     $comments = $wpdb->get_results("SELECT * $query");
     1974        $query = "FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved $post $typesql";
     1975    }
     1976
     1977    $comments = $wpdb->get_results("SELECT * $query $orderby");
    19791978    if ( '' === $total )
    19801979        $total = $wpdb->get_var("SELECT COUNT(comment_ID) $query");
Note: See TracChangeset for help on using the changeset viewer.