Check for MariaDB 10.5+ binaries, fall back to MySQL versions#6316
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request updates the database command retrieval logic to prefer MariaDB-specific binaries (mariadb-dump and mariadb-check) when available, falling back to standard MySQL commands otherwise. The implementation includes static caching to avoid repeated system calls. Feedback suggests refactoring the duplicated detection logic into a single helper function to adhere to DRY principles and improve maintainability.
There was a problem hiding this comment.
Pull request overview
This PR updates WP-CLI’s SQL helper utilities to better support MariaDB installations where the newer MariaDB-specific client binaries (introduced in MariaDB 10.5+) may not be present, addressing issue #6097.
Changes:
- Update
get_sql_dump_command()to prefermariadb-dumpon MariaDB, with a fallback tomysqldumpwhen not available. - Update
get_sql_check_command()to prefermariadb-checkon MariaDB, with a fallback tomysqlcheckwhen not available. - Cache the detected command in each helper to avoid repeated lookups.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #6097