Make WordPress Core

Ticket #5773: comment_date_key.diff

File comment_date_key.diff, 2.0 KB (added by ryan, 17 years ago)
  • wp-includes/version.php

     
    1616 *
    1717 * @global int $wp_db_version
    1818 */
    19 $wp_db_version = 6689;
     19$wp_db_version = 6730;
    2020
    2121?>
     22 No newline at end of file
  • wp-includes/comment.php

     
    207207
    208208        switch ( strtolower($timezone)) {
    209209                case 'gmt':
    210                         $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
     210                        $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 1");
    211211                        break;
    212212                case 'blog':
    213                         $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
     213                        $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 1");
    214214                        break;
    215215                case 'server':
    216216                        $lastcommentmodified = $wpdb->get_var($wpdb->prepare("SELECT DATE_ADD(comment_date_gmt, INTERVAL %s SECOND) FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1", $add_seconds_server));
  • wp-admin/includes/schema.php

     
    5252  user_id bigint(20) NOT NULL default '0',
    5353  PRIMARY KEY  (comment_ID),
    5454  KEY comment_approved (comment_approved),
    55   KEY comment_post_ID (comment_post_ID)
     55  KEY comment_post_ID (comment_post_ID),
     56  KEY comment_approved_date (comment_approved,comment_date)
    5657) $charset_collate;
    5758CREATE TABLE $wpdb->links (
    5859  link_id bigint(20) NOT NULL auto_increment,