From b0f6bcc8f3cb7622fe0eb74ec3adf981e637fcd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:32:28 +0000 Subject: [PATCH 1/3] Initial plan From a265c7d10eebd12d3f5ce2c33db0be45fc1cc30a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:35:24 +0000 Subject: [PATCH 2/3] Fix empty character set parameter issue in mysqlcheck commands Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/db-check.feature | 26 ++++++++++++++++++++++++++ src/DB_Command.php | 9 +++++++++ 2 files changed, 35 insertions(+) diff --git a/features/db-check.feature b/features/db-check.feature index aa5ce47b..7d14a4f7 100644 --- a/features/db-check.feature +++ b/features/db-check.feature @@ -136,3 +136,29 @@ Feature: Check the database When I try `wp db check --no-defaults --debug` Then STDERR should match #Debug \(db\): Running shell command: /usr/bin/env (mysqlcheck|mariadb-check) --no-defaults %s# + Scenario: Empty DB credentials should not cause empty parameter errors + Given a WP install + And a wp-config.php file: + """ + Date: Sun, 1 Feb 2026 19:38:21 +0000 Subject: [PATCH 3/3] Address code review feedback: handle null values and improve test Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/db-check.feature | 10 +++++++++- src/DB_Command.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/features/db-check.feature b/features/db-check.feature index 7d14a4f7..c98b3786 100644 --- a/features/db-check.feature +++ b/features/db-check.feature @@ -152,7 +152,15 @@ Feature: Check the database """ When I run `wp db check --debug` - Then STDERR should not contain: + Then STDERR should contain: + """ + Debug (db): Final MySQL command: + """ + And STDERR should not contain: + """ + --default-character-set='' + """ + And STDERR should not contain: """ --default-character-set= """ diff --git a/src/DB_Command.php b/src/DB_Command.php index 2096a0a9..b136169c 100644 --- a/src/DB_Command.php +++ b/src/DB_Command.php @@ -1832,7 +1832,7 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $int $required = array_filter( $required, static function ( $value ) { - return '' !== $value; + return null !== $value && '' !== $value; } );