You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ef282b
Browse filesBrowse the repository at this point in the historyBrowse files
Check the dump client for --ignore-table-data, reject --tables, support SQLite
- Detect support with command_supports_option() on the dump binary instead of
get_db_type(), since --ignore-table-data is a dump client option.
- Error when combined with --tables, which mariadb-dump silently ignores.
- Empty the listed tables in the temporary SQLite copy before .dump.
- Always unset the option, and only process string values.
- Document exact MariaDB versions; extend tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -469,7 +469,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
469
469
470
470
[--exclude_tables_data=<tables>]
471
471
The comma separated list of specific tables for which only the structure will be exported. Excluding this parameter will export data for all tables in the export.
472
-
Note: currently only supported by MariaDB.
472
+
Requires a dump client that supports --ignore-table-data (mariadb-dump from MariaDB 10.1.45, 10.2.32, 10.3.23, 10.4.13, 10.5.3 or later); MySQL's mysqldump does not. Cannot be combined with --tables.
473
473
474
474
[--include-tablespaces]
475
475
Skips adding the default --no-tablespaces option to mysqldump.
Copy file name to clipboardExpand all lines: src/DB_Command.php
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -686,7 +686,7 @@ public function query( $args, $assoc_args ) {
686
686
*
687
687
* [--exclude_tables_data=<tables>]
688
688
* : The comma separated list of specific tables for which only the structure will be exported. Excluding this parameter will export data for all tables in the export.
689
-
* Note: currently only supported by MariaDB.
689
+
* Requires a dump client that supports --ignore-table-data (mariadb-dump from MariaDB 10.1.45, 10.2.32, 10.3.23, 10.4.13, 10.5.3 or later); MySQL's mysqldump does not. Cannot be combined with --tables.
690
690
*
691
691
* [--include-tablespaces]
692
692
* : Skips adding the default --no-tablespaces option to mysqldump.
@@ -822,6 +822,8 @@ public function export( $args, $assoc_args ) {
// The dump client ignores --ignore-table-data for tables named with --tables.
852
+
if ( $has_tables ) {
853
+
WP_CLI::error( 'The --exclude_tables_data option cannot be combined with --tables.' );
854
+
}
849
855
850
-
if ( 'mariadb' !== Utils\get_db_type() ) {
851
-
WP_CLI::error( 'The --exclude_tables_data option is only supported by MariaDB.' );
856
+
// --ignore-table-data is a dump client option, so check the client rather than the server.
857
+
if ( ! $this->command_supports_option( $mysqldump_binary, 'ignore-table-data' ) ) {
858
+
WP_CLI::error( sprintf( 'The --exclude_tables_data option requires a dump client that supports --ignore-table-data (mariadb-dump from MariaDB 10.4.13, 10.5.3 or later). "%s" does not.', $mysqldump_binary ) );
0 commit comments