After [34529], if a compatible termmeta table is found on database upgrade, convert it to utf8mb4 collation.

Props dboulet.
Fixes #34224.

git-svn-id: https://develop.svn.wordpress.org/trunk@34978 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-10-09 02:06:15 +00:00
parent 5a55add794
commit fb6d5f4aba
2 changed files with 4 additions and 3 deletions

View File

@ -2630,10 +2630,11 @@ function pre_schema_upgrade() {
} }
// Upgrade versions prior to 4.4. // Upgrade versions prior to 4.4.
if ( $wp_current_db_version < 34370 ) { if ( $wp_current_db_version < 34978 ) {
// If compatible termmeta table is found, use it, but enforce a proper index. // If compatible termmeta table is found, use it, but enforce a proper index and update collation.
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->termmeta}'" ) && $wpdb->get_results( "SHOW INDEX FROM {$wpdb->termmeta} WHERE Column_name = 'meta_key'" ) ) { if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->termmeta}'" ) && $wpdb->get_results( "SHOW INDEX FROM {$wpdb->termmeta} WHERE Column_name = 'meta_key'" ) ) {
$wpdb->query( "ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" ); $wpdb->query( "ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
maybe_convert_table_to_utf8mb4( $wpdb->termmeta );
} }
} }
} }

View File

@ -11,7 +11,7 @@ $wp_version = '4.4-alpha-33636-src';
* *
* @global int $wp_db_version * @global int $wp_db_version
*/ */
$wp_db_version = 34903; $wp_db_version = 34978;
/** /**
* Holds the TinyMCE version * Holds the TinyMCE version