Skip to content

Commit 27dd210

Browse files
authored
Merge pull request #105 from wp-cli/mysqldump8-issues
pass `--column-statistics=0` to mysqldump command
2 parents c9b7a5e + 5dfe3fd commit 27dd210

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/DB_Command.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,14 @@ public function export( $args, $assoc_args ) {
474474
$assoc_args['result-file'] = $result_file;
475475
}
476476

477-
$command = '/usr/bin/env mysqldump --no-defaults %s';
477+
$support_column_statistics = exec( 'mysqldump --help | grep "column-statistics"' );
478+
479+
if ( $support_column_statistics ) {
480+
$command = '/usr/bin/env mysqldump --no-defaults --skip-column-statistics %s';
481+
} else {
482+
$command = '/usr/bin/env mysqldump --no-defaults %s';
483+
}
484+
478485
$command_esc_args = array( DB_NAME );
479486

480487
if ( isset( $assoc_args['tables'] ) ) {

0 commit comments

Comments
 (0)