Problem/Motivation

in #3421175: Update INSTALL.txt and hook_requirements() etc. with Drupal 11 platform requirements catch pointed out that MYSQLND_MINIMUM_VERSION or LIBMYSQLCLIENT_MINIMUM_VERSION haven't been changes since 2015. He also questioned if they are still needed.

Steps to reproduce

Proposed resolution

TBA

Remaining tasks

Discuss

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3437786

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

catch’s picture

This was originally added in #2529188: Provide better error handling for MySQL client and server utf8mb4 incompatibility, utf8mb4 has been around for a very long time now, so I wonder whether it's possible to have a client installed that could run into this error any more. Maybe we can just drop the constants and supporting code.

longwave’s picture

I am pretty sure we could drop this now, surely nobody is building PHP 8.3 linked to much older versions of mysqlnd or libmysqlclient.

quietone’s picture

In anticipation of agreement to remove them I made an MR

Gábor Hojtsy’s picture

Status: Active » Needs work

I also expect that we can drop it but I did not validate that.

There is also still this error message produced that is misleading (specifies a much lower version of MySQL):

        // Detect utf8mb4 incompatibility.
        if ($e->getCode() == Connection::UNSUPPORTED_CHARSET || ($e->getCode() == Connection::SQLSTATE_SYNTAX_ERROR && $e->errorInfo[1] == Connection::UNKNOWN_CHARSET)) {
          $this->fail(t('Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the <a href=":documentation" target="_blank">MySQL documentation</a> for more information.', [':documentation' => 'https://dev.mysql.com/doc/refman/5.0/en/cannot-initialize-character-set.html']));

It may still be possible to configure a DB without this? If that is the case, I would remove the very old version number reference, since Drupal 11 is by far not compatible with that anyway, so having MySQL 5.5.4 would not help users, despite what the message says.

longwave’s picture

libmysqlclient 5.5.3 shipped with MySQL 5.5.3 which was released in 2010 and was end of life in 2018, so in my opinion we can drop support for this now given that we do not support old PHP or database versions.

The mysqlnd check can also be dropped, the PHP version and mysqlnd versions are the same since PHP 7.4: https://github.com/php/php-src/commit/37043e07dfa57dbc567b7217ca7aa25a13...

longwave’s picture

Title: [policy] Decide what to do with MYSQLND_MINIMUM_VERSION and LIBMYSQLCLIENT_MINIMUM_VERSION » Remove MYSQLND_MINIMUM_VERSION and LIBMYSQLCLIENT_MINIMUM_VERSION checks
Status: Needs work » Needs review

Also removed the utf8mb4 fallback code noted in #6 given we don't support those versions any more.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Very nice indeed.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Left a comment on the MR.

quietone’s picture

Status: Needs work » Needs review
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Review was addressed. clientVersion() isn't part of the interface, isn't used in core, but GitLab search finds many false positives so I can't be sure it's unused in contrib - it isn't doing any harm by keeping it anyway.

alexpott’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 28d407eb05 to 11.x and 1a4aa4ea0e to 10.3.x. Thanks!

Backported to 10.3.x because the minimum version of PHP is 8.1 there and too new for this stuff too.

  • alexpott committed 1a4aa4ea on 10.3.x
    Issue #3437786 by quietone, longwave, catch, Gábor Hojtsy: Remove...

  • alexpott committed 28d407eb on 11.x
    Issue #3437786 by quietone, longwave, catch, Gábor Hojtsy: Remove...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.