Skip to content

Commit

Permalink
Fix MySQL8 column-statistics compatibility issue (#71)
Browse files Browse the repository at this point in the history
Fix MySQL8 column-statistics compatibility issue
  • Loading branch information
schlessera authored Nov 3, 2019
2 parents ad3eb31 + f577cfe commit 593ec79
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,15 @@ public function install_wp( $subdir = '' ) {
if ( $install_cache_path ) {
mkdir( $install_cache_path );
self::dir_diff_copy( $run_dir, self::$cache_dir, $install_cache_path );
self::run_sql( 'mysqldump --no-defaults', array( 'result-file' => "{$install_cache_path}.sql" ), true /*add_database*/ );

$mysqldump_binary = Utils\force_env_on_nix_systems( 'mysqldump' );
$support_column_statistics = exec( "{$mysqldump_binary} --help | grep 'column-statistics'" );
$command = 'mysqldump --no-defaults';
if ( $support_column_statistics ) {
$command .= ' --skip-column-statistics';
}

self::run_sql( $command, array( 'result-file' => "{$install_cache_path}.sql" ), true /*add_database*/ );
}
}
}
Expand Down

0 comments on commit 593ec79

Please sign in to comment.