]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1896055: Don't talk to MariaDB with the MySQL driver (#170)
authorDave Miller <justdave@bugzilla.org>
Sat, 11 May 2024 18:01:45 +0000 (14:01 -0400)
committerGitHub <noreply@github.com>
Sat, 11 May 2024 18:01:45 +0000 (14:01 -0400)
Bugzilla/DB.pm
template/en/default/setup/strings.txt.pl

index 9f30cac25c4682ebf21cb16f373eef5a8befa061..d826100938c2825e95c18cdeb049056f200e7bfa 100644 (file)
@@ -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 <<EOT;
-
-Your $sql_server v$sql_vers is blocklisted. Please check the
-release notes for details or try a different database engine
-or version.
-
-EOT
+    die install_string('db_blocklisted', {server=>$sql_server, vers=>$sql_vers});
   }
   if (!$version_ok) {
-    die <<EOT;
-
-Your $sql_server v$sql_vers is too old. Bugzilla requires version
-$sql_want or later of $sql_server. Please download and install a
-newer version.
-
-EOT
+    die install_string('db_too_old', {
+      server => $sql_server,
+      vers   => $sql_vers,
+      want   => $sql_want,
+    });
   }
 
   # This is used by subclasses.
index f6cfa18937bfe09ea94e3799320f29f47bed8e4b..10851a120086868927cc6b1501d8d1e37ec59aba 100644 (file)
@@ -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     => <<END,
+
+Your ##server## v##vers## is blocklisted. Please check the
+release notes for details or try a different database engine
+or version.
+END
   db_enum_setup      => "Setting up choices for standard drop-down fields:",
+  db_maria_on_mysql  => <<END,
+
+You appear to be using the 'mysql' database driver but the
+database engine Bugzilla connected to identifies as
+ MariaDB ##vers##
+MariaDB 10.6 and newer are no longer compatible with the mysql
+database driver. Bugzilla now uses a separate driver for all
+versions of MariaDB.
+
+Please edit localconfig and set:
+
+\$db_driver = 'mariadb';
+END
   db_schema_init     => "Initializing bz_schema...",
   db_table_new       => "Adding new table ##table##...",
   db_table_setup     => "Creating tables...",
+  db_too_old         => <<END,
+
+Your ##server## v##vers## is too old. Bugzilla requires version
+##want## or later of ##server##. Please download and install a
+newer version.
+END
   done               => 'done.',
   enter_or_ctrl_c    => "Press Enter to continue or Ctrl-C to exit...",
   error_localconfig_read => <<'END',