Multisite: Fix broken update `blog_versions` query after [41661].
Props Mista-Flo, lenasterg, flixos90. Merges [42210] to the 4.9 branch. Fixes #42641. Built from https://develop.svn.wordpress.org/branches/4.9@42212 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
85d9b63062
commit
66a3d52431
|
@ -435,11 +435,11 @@ function wp_upgrade() {
|
|||
if ( is_multisite() ) {
|
||||
$site_id = get_current_blog_id();
|
||||
|
||||
if ( $wpdb->get_row( $wpdb->prepare( 'SELECT blog_id FROM %s WHERE blog_id = %d', $wpdb->blog_versions, $site_id ) ) ) {
|
||||
$wpdb->query( $wpdb->prepare( 'UPDATE %s SET db_version = %d WHERE blog_id = %d', $wpdb->blog_versions, $wp_db_version, $site_id ) );
|
||||
} else {
|
||||
$wpdb->query( $wpdb->prepare( 'INSERT INTO %s ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, %s);', $wpdb->blog_versions, $site_id, $wp_db_version, NOW() ) );
|
||||
}
|
||||
if ( $wpdb->get_row( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = %d", $site_id ) ) ) {
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->blog_versions} SET db_version = %d WHERE blog_id = %d", $wp_db_version, $site_id ) );
|
||||
} else {
|
||||
$wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9.1-alpha-42197';
|
||||
$wp_version = '4.9.1-alpha-42212';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue