wp-cli-tests icon indicating copy to clipboard operation
wp-cli-tests copied to clipboard

Broken MariaDB detection - looking at client instead of server

Open schlessera opened this issue 6 months ago • 0 comments
trafficstars

The change in https://github.com/wp-cli/wp-cli-tests/pull/246 fixes the issue of allowing different client binary names.

However, I now realized that we're still using a faulty approach to even try to detect MySQL vs MariaDB to begin with. In the script, where we try to deduce the type, we're actually querying the version of the mysql client binary, not of the DB version. The type of the client is not really relevant here, all we are interested in is what dialect of SQL the server will need.

The script needs to split this into different phases:

  1. Detect what client binary can be used
  2. Use said client binary to connect to the server and retrieve the server version
  3. From the server version, extract the DB server type, i.e. MySQL or MariaDB

schlessera avatar May 05 '25 20:05 schlessera