Skip to content

Commit 593ec79

Browse files
authored
Fix MySQL8 column-statistics compatibility issue (#71)
Fix MySQL8 column-statistics compatibility issue
2 parents ad3eb31 + f577cfe commit 593ec79

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,15 @@ public function install_wp( $subdir = '' ) {
856856
if ( $install_cache_path ) {
857857
mkdir( $install_cache_path );
858858
self::dir_diff_copy( $run_dir, self::$cache_dir, $install_cache_path );
859-
self::run_sql( 'mysqldump --no-defaults', array( 'result-file' => "{$install_cache_path}.sql" ), true /*add_database*/ );
859+
860+
$mysqldump_binary = Utils\force_env_on_nix_systems( 'mysqldump' );
861+
$support_column_statistics = exec( "{$mysqldump_binary} --help | grep 'column-statistics'" );
862+
$command = 'mysqldump --no-defaults';
863+
if ( $support_column_statistics ) {
864+
$command .= ' --skip-column-statistics';
865+
}
866+
867+
self::run_sql( $command, array( 'result-file' => "{$install_cache_path}.sql" ), true /*add_database*/ );
860868
}
861869
}
862870
}

0 commit comments

Comments
 (0)