Skip to content

Commit

Permalink
Bug 1896055: Don't talk to MariaDB with the MySQL driver (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
justdave committed May 11, 2024
1 parent d1acd81 commit e50ec16
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 15 deletions.
32 changes: 17 additions & 15 deletions Bugzilla/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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.
Expand Down
25 changes: 25 additions & 0 deletions template/en/default/setup/strings.txt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,35 @@ END
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',
Expand Down

0 comments on commit e50ec16

Please sign in to comment.