Skip to content

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

Merged
schlessera merged 2 commits into
masterfrom
mysqldump8-issues
Jul 31, 2018
Merged

pass --column-statistics=0 to mysqldump command#105
schlessera merged 2 commits into
masterfrom
mysqldump8-issues

Conversation

@miya0001

Copy link
Copy Markdown
Member

Related: #103

Comment thread src/DB_Command.php Outdated

$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 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@miya0001

Copy link
Copy Markdown
Member Author

@schlessera

I changed like following.

$support_column_statistics = exec( 'mysqldump --help | grep "column-statistics"' );

Because mysqldump --version on MySQL 8 returns like following, so I think this text is difficult to check whether we actually are using MySQL.

mysqldump  Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)
@schlessera

Copy link
Copy Markdown
Member

Okay, let's try the change like this and monitor whether people still have issues with MySQL v8+ after that.

@schlessera
schlessera merged commit 27dd210 into master Jul 31, 2018
@schlessera
schlessera deleted the mysqldump8-issues branch July 31, 2018 01:46
domq added a commit to epfl-si/wp-ops that referenced this pull request Jun 12, 2020
After
epfl-si/polylang-cli@1d262be
we no longer need this version pin. On the other hand, we need
wp-cli/db-command#105 today, because our
backups aree broken.
domq added a commit to epfl-si/wp-ops that referenced this pull request Jun 12, 2020
After
epfl-si/polylang-cli@1d262be
we no longer need this version pin. On the other hand, we need
wp-cli/db-command#105 today, because our
backups aree broken.
GregLeBarbar pushed a commit to epfl-si/wp-ops that referenced this pull request Jul 3, 2020
After
epfl-si/polylang-cli@1d262be
we no longer need this version pin. On the other hand, we need
wp-cli/db-command#105 today, because our
backups aree broken.
danielbachhuber pushed a commit that referenced this pull request Nov 18, 2022
pass `--column-statistics=0` to mysqldump command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants