From 5c7ffda69a3667584241f1055205a5a917faacf2 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 8 Feb 2024 22:17:43 -0500 Subject: [PATCH] Adapt tests to mariadb 10.11 As of mariadb 10.11 (Fedora 40), the documented method of reverting the user account to mysql_native_password post-creation fails with: ERROR 1698 (28000): Access denied for user 'mockbuild'@'localhost' Using the documented method for setting this at creation time works with both 10.5 and 10.11. --- rubygem-mysql2.spec | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rubygem-mysql2.spec b/rubygem-mysql2.spec index 4ac518c..3f9f7f0 100644 --- a/rubygem-mysql2.spec +++ b/rubygem-mysql2.spec @@ -6,7 +6,7 @@ Name: rubygem-%{gem_name} Version: 0.5.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A simple, fast Mysql library for Ruby, binding to libmysql License: MIT URL: https://github.com/brianmario/mysql2 @@ -113,7 +113,9 @@ MYSQL_TEST_LOG="${TOP_DIR}/mysql.log" MYSQL_TEST_PID_FILE="${TOP_DIR}/mysql.pid" mkdir "${MYSQL_TEST_DATA_DIR}" +# See https://mariadb.com/kb/en/authentication-from-mariadb-10-4/#configuring-mariadb-install-db-to-revert-to-the-previous-authentication-method mysql_install_db \ + --auth-root-authentication-method=normal \ --datadir="${MYSQL_TEST_DATA_DIR}" \ --log-error="${MYSQL_TEST_LOG}" @@ -140,13 +142,6 @@ if ! "${conn_found}"; then exit 1 fi -# Reset password for the root user due to MariaDB 10.4 authentication change. -# See https://mariadb.com/kb/en/authentication-from-mariadb-104/#altering-the-user-account-to-revert-to-the-previous-authentication-method -mysql -u ${MYSQL_TEST_USER} \ - -e "ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('')" \ - -S "${MYSQL_TEST_SOCKET}" \ - -P "${MYSQL_TEST_PORT}" - # See https://github.com/brianmario/mysql2/blob/master/ci/setup.sh mysql -u root \ -e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test' \ @@ -196,6 +191,9 @@ kill "$(cat "${MYSQL_TEST_PID_FILE}")" %changelog +* Fri Feb 09 2024 Yaakov Selkowitz - 0.5.5-4 +- Adapt tests to mariadb 10.11 + * Fri Jan 26 2024 Fedora Release Engineering - 0.5.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild