mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Order by and index on comment_date_gmt instead of comment_date to insulate order from offset changes. fixes #5773
git-svn-id: http://svn.automattic.com/wordpress/trunk@6736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
057c2dfccf
commit
8fecb97b09
@ -53,7 +53,7 @@ CREATE TABLE $wpdb->comments (
|
|||||||
PRIMARY KEY (comment_ID),
|
PRIMARY KEY (comment_ID),
|
||||||
KEY comment_approved (comment_approved),
|
KEY comment_approved (comment_approved),
|
||||||
KEY comment_post_ID (comment_post_ID),
|
KEY comment_post_ID (comment_post_ID),
|
||||||
KEY comment_approved_date (comment_approved,comment_date)
|
KEY comment_approved_date_gmt (comment_approved,comment_date_gmt)
|
||||||
) $charset_collate;
|
) $charset_collate;
|
||||||
CREATE TABLE $wpdb->links (
|
CREATE TABLE $wpdb->links (
|
||||||
link_id bigint(20) NOT NULL auto_increment,
|
link_id bigint(20) NOT NULL auto_increment,
|
||||||
|
@ -207,10 +207,10 @@ function get_lastcommentmodified($timezone = 'server') {
|
|||||||
|
|
||||||
switch ( strtolower($timezone)) {
|
switch ( strtolower($timezone)) {
|
||||||
case 'gmt':
|
case 'gmt':
|
||||||
$lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 1");
|
$lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
|
||||||
break;
|
break;
|
||||||
case 'blog':
|
case 'blog':
|
||||||
$lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 1");
|
$lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1");
|
||||||
break;
|
break;
|
||||||
case 'server':
|
case 'server':
|
||||||
$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));
|
$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));
|
||||||
|
@ -16,6 +16,6 @@ $wp_version = '2.4-bleeding';
|
|||||||
*
|
*
|
||||||
* @global int $wp_db_version
|
* @global int $wp_db_version
|
||||||
*/
|
*/
|
||||||
$wp_db_version = 6731;
|
$wp_db_version = 6736;
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user