From fe941ffb61f46be91be1f62251ec60fca5f8c5b2 Mon Sep 17 00:00:00 2001
From: xjm <xjm@65776.no-reply.drupal.org>
Date: Sat, 16 Jul 2022 09:56:39 -0500
Subject: [PATCH] Issue #3296108 by catch, dww, Spokje, mondrake:
 mysql_requirements() assumes it's used for the default connection

---
 core/modules/mysql/mysql.install | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/modules/mysql/mysql.install b/core/modules/mysql/mysql.install
index 2f4f217dda0f..11a098ed5b45 100644
--- a/core/modules/mysql/mysql.install
+++ b/core/modules/mysql/mysql.install
@@ -17,6 +17,10 @@ function mysql_requirements($phase) {
     // Test with MySql databases.
     if (Database::isActiveConnection()) {
       $connection = Database::getConnection();
+      // Only show requirements when MySQL is the default database connection.
+      if (!($connection->driver() === 'mysql' && $connection->getProvider() === 'mysql')) {
+        return [];
+      }
 
       $query = 'SELECT @@SESSION.tx_isolation';
       // The database variable "tx_isolation" has been removed in MySQL v8.0 and
-- 
GitLab