From 3c7b7f7133cae1c3a6bb2e1396b819d8c6c686c5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 9 Oct 2015 02:07:25 +0000 Subject: [PATCH] After [34529], if a compatible `termmeta` table is found on database upgrade, convert it to `utf8mb4` collation. Props dboulet. Fixes #34224. Built from https://develop.svn.wordpress.org/trunk@34978 git-svn-id: http://core.svn.wordpress.org/trunk@34943 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 5 +++-- wp-includes/version.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index cb53d2f4d1..dafb19a3f2 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -2630,10 +2630,11 @@ function pre_schema_upgrade() { } // Upgrade versions prior to 4.4. - if ( $wp_current_db_version < 34370 ) { - // If compatible termmeta table is found, use it, but enforce a proper index. + if ( $wp_current_db_version < 34978 ) { + // 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'" ) ) { $wpdb->query( "ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" ); + maybe_convert_table_to_utf8mb4( $wpdb->termmeta ); } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 36927f8b4f..76c84f509c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,14 +4,14 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34977'; +$wp_version = '4.4-alpha-34978'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ -$wp_db_version = 34903; +$wp_db_version = 34978; /** * Holds the TinyMCE version