Ignore the sitecategories table during network update if global terms are not enabled
|Reported by:||nofearinc||Owned by:||dd32|
While updating a multisite network, I saw that in the error log:
WordPress database error Table 'automobile.au_sitecategories' doesn't exist for query SHOW FULL COLUMNS FROM `au_sitecategories` made by wp_upgrade, upgrade_network, maybe_convert_table_to_utf8mb4
I found that upgrade_network runs maybe_convert_table_to_utf8mb4 in wp-admin/includes/upgrade.php by fetching $wpdb->tables( 'global' ); which always returns the sitecategories table even if it wasn't defined.
I've added the solution provided by nacin for #12964 in both changeset upgrade statements to ignore the database query if global terms are not enabled. I also wonder whether this shouldn't be handled in the wpdb class when calling the switch within the tables function.