Skip to content

Commit

Permalink
Merge pull request #143 from lcache/142-create-table
Browse files Browse the repository at this point in the history
Append `ROW_FORMAT=DYNAMIC` when using Barracuda with utf8mb4
  • Loading branch information
danielbachhuber committed Aug 21, 2017
2 parents b101b3d + 2ab8c44 commit 65a8faa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wp-lcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ function wp_lcache_initialize_database_schema() {
global $wpdb;

$charset_collate = $wpdb->get_charset_collate();
// Barracuda needs ROW_FORMAT=DYNAMIC when using utf8mb4
if ( false !== stripos( $charset_collate, 'utf8mb4' ) ) {
$innodb_file_format = $wpdb->get_var( 'SELECT @@innodb_file_format' );
if ( false !== stripos( $innodb_file_format, 'Barracuda' ) ) {
$charset_collate .= ' ROW_FORMAT=DYNAMIC';
}
}

// @codingStandardsIgnoreStart
$events_table = $GLOBALS['table_prefix'] . 'lcache_events';
Expand Down

0 comments on commit 65a8faa

Please sign in to comment.