From fb6d5f4aba78d0d8e214adc8a8ea974d1051a47c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 9 Oct 2015 02:06:15 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/upgrade.php | 5 +++-- src/wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index cb53d2f4d1..dafb19a3f2 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/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/src/wp-includes/version.php b/src/wp-includes/version.php index f245e1fb8e..5dc9a1f121 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -11,7 +11,7 @@ $wp_version = '4.4-alpha-33636-src'; * * @global int $wp_db_version */ -$wp_db_version = 34903; +$wp_db_version = 34978; /** * Holds the TinyMCE version