From e50ec16596eeb7522beafd3dae1c935c09b9d7f7 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Sat, 11 May 2024 14:01:45 -0400 Subject: [PATCH] Bug 1896055: Don't talk to MariaDB with the MySQL driver (#170) --- Bugzilla/DB.pm | 32 +++++++++++++----------- template/en/default/setup/strings.txt.pl | 25 ++++++++++++++++++ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 9f30cac25c..d826100938 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -244,7 +244,17 @@ sub bz_check_server_version { # '5.5.5-' then we can assume this is MariaDB and the real version number # will immediately follow that. This was removed in MariaDB-11.0. The # version should always contain "MariaDB" if it is indeed MariaDB. - $db = DB_MODULE->{'mariadb'}; + if (lc($db->{name}) eq 'mysql') { + if ($output) { + Bugzilla::Install::Requirements::_checking_for({ + package => $db->{name}, + wanted => $db->{version}, + ok => 0, + }); + } + die install_string('db_maria_on_mysql', {vers => $sql_vers}); + } + } my $sql_dontwant = exists $db->{db_blocklist} ? $db->{db_blocklist} : []; my $sql_want = $db->{db_version}; @@ -269,22 +279,14 @@ sub bz_check_server_version { # Check what version of the database server is installed and let # the user know if the version is too old to be used with Bugzilla. if ($blocklisted) { - die <$sql_server, vers=>$sql_vers}); } if (!$version_ok) { - die < $sql_server, + vers => $sql_vers, + want => $sql_want, + }); } # This is used by subclasses. diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index f6cfa18937..10851a1200 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -56,10 +56,35 @@ Re-run checksetup.pl in interactive mode (without an 'answers' file) to continue. END cpan_bugzilla_home => "WARNING: Using the Bugzilla directory as the CPAN home.", + db_blocklisted => < "Setting up choices for standard drop-down fields:", + db_maria_on_mysql => < "Initializing bz_schema...", db_table_new => "Adding new table ##table##...", db_table_setup => "Creating tables...", + db_too_old => < 'done.', enter_or_ctrl_c => "Press Enter to continue or Ctrl-C to exit...", error_localconfig_read => <<'END', -- 2.47.2