Make WordPress Core

Changeset 49454


Ignore:
Timestamp:
10/30/2020 06:25:22 PM (4 years ago)
Author:
whyisjake
Message:

Upgrade/Install: During the install process, add additional checking for exising tables.

This commit brings the changes in [49452] to the 5.4 branch.

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.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/src/wp-includes/functions.php

    r49391 r49454  
    17441744
    17451745        $described_table = $wpdb->get_results( "DESCRIBE $table;" );
    1746         if ( is_array( $described_table ) && count( $described_table ) === 0 ) {
     1746        if (
     1747            ( ! $described_table && empty( $wpdb->last_error ) ) ||
     1748            ( is_array( $described_table ) && 0 === count( $described_table ) )
     1749        ) {
    17471750            continue;
    17481751        }
Note: See TracChangeset for help on using the changeset viewer.