Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass `--column-statistics=0` to mysqldump command #105

merged 2 commits into from Jul 31, 2018
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+9 −1
Diff settings


Just for now

Copy path View file
@@ -474,7 +474,15 @@ public function export( $args, $assoc_args ) {
$assoc_args['result-file'] = $result_file;
$command = '/usr/bin/env mysqldump --no-defaults %s';
$mysqldump_version = exec( "/usr/bin/env mysqldump --version --no-defaults" );
$mysqldump_version = preg_replace( "/^.+([0-9]+\.[0-9]+\.[0-9]+)(.+)$/", "$1", $mysqldump_version );

This comment has been minimized.

Copy link

schlessera Jul 20, 2018


This test does not take MariaDB into account.

Here's a version string from MariaDB from my current local setup:

$ /usr/bin/env mysqldump --version --no-defaults
mysqldump  Ver 10.16 Distrib 10.2.14-MariaDB, for osx10.13 (x86_64)

So you not only need to check the version, but also whether you actually are using MySQL, not some variant.

if ( version_compare( $mysqldump_version, '8.0', '>=' ) ) {
$command = '/usr/bin/env mysqldump --no-defaults --column-statistics=0 %s';
} else {
$command = '/usr/bin/env mysqldump --no-defaults %s';
$command_esc_args = array( DB_NAME );
if ( isset( $assoc_args['tables'] ) ) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.