Mailing List Archive

rt branch 5.0/dbd-mysql-version created. rt-5.0.5-200-g525bf348f3
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/dbd-mysql-version has been created
at 525bf348f399e901f3ed9306e3bd17e9d68d1a13 (commit)

- Log -----------------------------------------------------------------
commit 525bf348f399e901f3ed9306e3bd17e9d68d1a13
Author: sunnavy <sunnavy@bestpractical.com>
Date: Thu Mar 28 16:00:22 2024 -0400

Add mysql5/MariaDB db types to install old DBD::mysql version

DBD::mysql 5.001+ doesn't support MySQL 5.7 and MariaDB.

diff --git a/Makefile.in b/Makefile.in
index 74506a9495..29e3dc56a7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -187,7 +187,7 @@ WEB_HANDLER = @WEB_HANDLER@

#
# DB_TYPE defines what sort of database RT trys to talk to
-# "mysql", "Oracle", "Pg", and "SQLite" are known to work.
+# "mysql", "mysql5", "MariaDB", "Oracle", "Pg", and "SQLite" are known to work.

DB_TYPE = @DB_TYPE@

diff --git a/README.MariaDB b/README.MariaDB
index 04a235aa8a..1e952cf031 100644
--- a/README.MariaDB
+++ b/README.MariaDB
@@ -1,3 +1,16 @@
+DB TYPE
+-------
+
+Starting with RT 5.0.6, you must specify "MariaDB" as the DB type when running
+"configure", i.e.
+
+ ./configure --with-db-type=MariaDB
+
+This is to install a version of DBD::mysql that still supports MariaDB.
+The newest versions of DBD::mysql do not support MariaDB. We plan to
+switch to "DBD::MariaDB" in the future when it's fully compatible
+with RT.
+
CHARACTER SETS
--------------

diff --git a/README.MySQL b/README.MySQL
index 3011f59f4e..8ee738dabe 100644
--- a/README.MySQL
+++ b/README.MySQL
@@ -1,3 +1,26 @@
+MYSQL 8
+-------
+
+The default DB type (--with-db-type) for configure is "mysql", which
+works with MySQL 8. If the MySQL 8 database or client libraries are not
+yet available in your OS package system, you may need to add the
+MySQL repository directly. For details, see: https://dev.mysql.com/downloads/
+
+MYSQL 5.7
+---------
+
+MySQL 5.7 has reached end of life, but it is possible to run
+with extended support from Oracle. If you are still running it, specify
+"--with-db-type=mysql5" when running "configure" method, i.e.
+
+ ./configure --with-db-type=mysql5
+
+This will prompt RT's installer to use a compatible version of
+DBD::mysql that still supports version 5.7 and older. The latest
+versions of DBD::mysql will not work with 5.7 and older.
+
+CHARACTER SETS
+--------------
Starting with RT 5.0.0, the minimum supported MySQL version is 5.7.7
because this is the first version to provide full support for 4 byte
utf8 characters in tables and indexes. Read on for details on this
diff --git a/README.md b/README.md
index 7ccc11320e..dbc8aa4106 100644
--- a/README.md
+++ b/README.md
@@ -94,14 +94,20 @@ RT is commercially-supported software. To purchase hosting, support, training, c
```
./configure --help
```
- Peruse the options, then rerun `./configure` with the flags you want.
+ Or review the options on our [documentation page for configure](https://docs.bestpractical.com/rt/latest/configure.html).

- RT defaults to installing in `/opt/rt5` with MySQL as its database. It
+ Then re-run `./configure` with the flags you want.
+
+ RT defaults to installing in `/opt/rt5`. It
tries to guess which of `www-data`, `www`, `apache` or `nobody` your
webserver will run as, but you can override that behavior. Note
that the default install directory in `/opt/rt5` does not work under
SELinux's default configuration.

+ The default database type (--with-db-type) is `mysql`, which means
+ MySQL version 8 and later. Starting in RT 5.0.6, use `mysql5` to run
+ MySQL 5.7 or older, and use `MariaDB` to run with MariaDB.
+
If you are upgrading from a previous version of RT, please review
the upgrade notes for the appropriate versions, which can be found
in `docs/UPGRADING-*`.
diff --git a/configure.ac b/configure.ac
index dd34674364..b540d55e77 100755
--- a/configure.ac
+++ b/configure.ac
@@ -116,11 +116,11 @@ AC_SUBST(LIBS_GROUP)
dnl DB_TYPE
AC_ARG_WITH(db-type,
AS_HELP_STRING([--with-db-type=TYPE],
- [.sort of database RT will use (default: mysql) (mysql, Pg, Oracle and SQLite are valid)]),
+ [.sort of database RT will use (default: mysql) (mysql, mysql5, MariaDB, Pg, Oracle, and SQLite are valid)]),
DB_TYPE=$withval,
DB_TYPE=mysql)
-if test "$DB_TYPE" != 'mysql' -a "$DB_TYPE" != 'Pg' -a "$DB_TYPE" != 'SQLite' -a "$DB_TYPE" != 'Oracle' ; then
- AC_MSG_ERROR([Only Oracle, Pg, mysql and SQLite are valid db types])
+if test "$DB_TYPE" != 'mysql' -a "$DB_TYPE" != 'mysql5' -a "$DB_TYPE" != 'MariaDB' -a "$DB_TYPE" != 'Pg' -a "$DB_TYPE" != 'SQLite' -a "$DB_TYPE" != 'Oracle' ; then
+ AC_MSG_ERROR([.Only Oracle, Pg, mysql, mysql5, MariaDB, and SQLite are valid db types])
fi
AC_SUBST(DB_TYPE)

@@ -132,6 +132,15 @@ fi

AC_SUBST(DATABASE_ENV_PREF)

+dnl DATABASE_TYPE
+if test "$DB_TYPE" = "mysql5" || test "$DB_TYPE" = "MariaDB"; then
+ DATABASE_TYPE="mysql"
+else
+ DATABASE_TYPE="$DB_TYPE"
+fi
+
+AC_SUBST(DATABASE_TYPE)
+
dnl DB_HOST
AC_ARG_WITH(db-host,
AS_HELP_STRING([--with-db-host=HOSTNAME],
diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index 8921c52723..36b3115a29 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -667,6 +667,21 @@ headers like "EmailAddress" now have spaces added so the header will appear like
This should make headers more readable, but if you have any automated processes that
parse the headers, you will need to update your parsing code.

+=item Running RT with MariaDB and MySQL 5.7
+
+RT uses the perl module DBD::mysql to connect to MySQL-type databases, and before
+version 5.001, it worked with older MySQL versions like 5.7, newer versions like 8,
+and all versions of MariaDB. Starting with DBD::mysql 5.001, it supports only
+MySQL 8 and newer.
+
+To align with this change, RT's C<configure> script now has two new options available
+for C<--with-db-type>. To run with MySQL 5.7 or older, use C<mysql5>. To run with
+MariaDB, use C<MariaDB>. These will configure the installer to use an older,
+compatible version of DBD::mysql.
+
+If you install a newer version of DBD::mysql by mistake, you can uninstall it or
+manually force install a version older than 5.001.
+
=back

=cut
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 2c4a9f3025..39a37a8ebd 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -197,7 +197,7 @@ Database driver being used; case matters. Valid types are "mysql",

=cut

-Set($DatabaseType, "@DB_TYPE@");
+Set($DatabaseType, "@DATABASE_TYPE@");

=item C<$DatabaseHost>, C<$DatabaseRTHost>

diff --git a/etc/cpanfile b/etc/cpanfile
index e20d748af1..877f7f8042 100644
--- a/etc/cpanfile
+++ b/etc/cpanfile
@@ -163,6 +163,14 @@ feature 'mysql' => sub {
requires 'DBD::mysql', '>= 2.1018, != 4.042';
};

+feature 'mysql5' => sub {
+ requires 'DBD::mysql', '>= 2.1018, != 4.042, < 5.001';
+};
+
+feature 'mariadb' => sub {
+ requires 'DBD::mysql', '>= 2.1018, != 4.042, < 5.001';
+};
+
feature 'oracle' => sub {
requires 'DBD::Oracle', '!= 1.23';
};
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 057c87d92e..0b56709db5 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -61,7 +61,7 @@ my %args;
GetOptions(
\%args,
'install!',
- 'with-MYSQL', 'with-PG', 'with-SQLITE', 'with-ORACLE',
+ 'with-MYSQL', 'with-MYSQL5', 'with-MARIADB', 'with-PG', 'with-SQLITE', 'with-ORACLE',
'with-FASTCGI', 'with-MODPERL2', 'with-STANDALONE',

'with-DEVELOPER',
@@ -101,7 +101,7 @@ my %default = (
'with-DROPBOX' => (uc(q{@ATTACHMENT_STORE@}) eq 'DROPBOX'),
);

-$default{"with-".uc("@DB_TYPE@")} = 1 unless grep {$args{"with-$_"}} qw/MYSQL PG SQLITE ORACLE/;
+$default{"with-".uc("@DB_TYPE@")} = 1 unless grep {$args{"with-$_"}} qw/MYSQL MYSQL5 MARIADB PG SQLITE ORACLE/;
unless (grep {$args{"with-$_"}} qw/FASTCGI MODPERL1 MODPERL2 STANDALONE/) {
$default{"with-".uc($_)} = 1 for grep {defined && length} split /,/, "@WEB_HANDLER@"
}
@@ -500,6 +500,10 @@ no effect when used with Perl 5.11 or above.

=item B<--with-mysql>

+=item B<--with-mysql5>
+
+=item B<--with-mariadb>
+
=item B<--with-pg>

=item B<--with-oracle>

-----------------------------------------------------------------------


hooks/post-receive
--
rt
_______________________________________________
rt-commit mailing list
rt-commit@lists.bestpractical.com
https://lists.bestpractical.com/mailman/listinfo/rt-commit