use constant DB_MODULE => {
# MySQL 5.0.15 was the first production 5.0.x release.
'mysql' => {db => 'Bugzilla::DB::Mysql', db_version => '5.0.15',
- dbd => {
+ db_blacklist => ['^[89]\.'],
+ # the following is a "human-readable" version to show in the
+ # release notes
+ db_blklst_str => '>= 8.0',
+ dbd => {
package => 'DBD-mysql',
module => 'DBD::mysql',
# Disallow development versions
version => '4.001',
},
name => 'MySQL'},
+
+ # MariaDB is a drop-in replacement for MySQL and works with Bugzilla
+ 'mariadb' => {db => 'Bugzilla::DB::Mysql', db_version => '5.1',
+ # MariaDB is indistinguishable from MySQL, but skipped 8 and
+ # 9 so blacklist it anyway in case someone has the driver set
+ # to mariadb but actually has MySQL.
+ db_blacklist => ['^[89]\.'],
+ # no string to show the user on the release notes though.
+ dbd => {
+ package => 'DBD-mysql',
+ module => 'DBD::mysql',
+
+ # Disallow development versions
+ blacklist => ['_'],
+
+ # For UTF-8 support. 4.001 makes sure that blobs aren't
+ # marked as UTF-8.
+ version => '4.001',
+ },
+ name => 'MariaDB'
+ },
+
# Also see Bugzilla::DB::Pg::bz_check_server_version, which has special
# code to require DBD::Pg 2.17.2 for PostgreSQL 9 and above.
'pg' => {db => 'Bugzilla::DB::Pg', db_version => '8.03.0000',
$self->disconnect;
my $sql_want = $db->{db_version};
+ my $sql_dontwant = exists $db->{db_blacklist} ? $db->{db_blacklist} : [];
my $version_ok = vers_cmp($sql_vers, $sql_want) > -1 ? 1 : 0;
+ my $blacklisted;
+ if ($version_ok) {
+ $blacklisted = grep($sql_vers =~ /$_/, @$sql_dontwant);
+ $version_ok = 0 if $blacklisted;
+ }
my $sql_server = $db->{name};
if ($output) {
Bugzilla::Install::Requirements::_checking_for({
package => $sql_server, wanted => $sql_want,
- found => $sql_vers, ok => $version_ok });
+ found => $sql_vers, ok => $version_ok,
+ blacklisted => $blacklisted });
}
# 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 ($blacklisted) {
+ die <<EOT;
+
+Your $sql_server v$sql_vers is blacklisted. Please check the
+release notes for details or try a different database engine
+or version.
+
+EOT
+ }
if (!$version_ok) {
die <<EOT;