From 4b91d4e5238fa7f60e1606db391b95ac6f998848 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Fri, 30 Oct 2020 17:52:07 +0000 Subject: [PATCH] Upgrade/Install: During the install process, add additional checking for exising tables. If reinstalling WordPress, there is a condition where tables would exist in the database. Ensures that when that is the case, the install process can carry along without issue. Fixes #51676. Props xknown, garubi, mukesh27, desrosj, johnbillion, metalandcoffee, davidbaumwald, whyisjake. Built from https://develop.svn.wordpress.org/trunk@49452 git-svn-id: http://core.svn.wordpress.org/trunk@49211 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 3d0412630e..5c44f37e8a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1757,7 +1757,10 @@ function is_blog_installed() { } $described_table = $wpdb->get_results( "DESCRIBE $table;" ); - if ( is_array( $described_table ) && count( $described_table ) === 0 ) { + if ( + ( ! $described_table && empty( $wpdb->last_error ) ) || + ( is_array( $described_table ) && 0 === count( $described_table ) ) + ) { continue; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 929e49b59c..971e33d1bd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta2-49451'; +$wp_version = '5.6-beta2-49452'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.