[Rt-commit] rt branch 5.0/dbd-mysql-version created. rt-5.0.5-200-g5b1d4810e4

BPS Git Server git at git.bestpractical.com
Thu Mar 28 20:38:02 UTC 2024


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  5b1d4810e48aa76805c7c374cfbfec530391ccb9 (commit)

- Log -----------------------------------------------------------------
commit 5b1d4810e48aa76805c7c374cfbfec530391ccb9
Author: sunnavy <sunnavy at 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..89ccf03db0 100644
--- a/README.MariaDB
+++ b/README.MariaDB
@@ -83,3 +83,15 @@ You can confirm that timezone tables are populated by running:
 
 If the result is "2020-07-27 21:00:00" the timezones are populated. If the
 result is NULL then time zones are not populated.
+
+DB TYPE
+-------
+
+Since RT 5.0.6, you can specify "MariaDB" as the db type when running
+"configure", i.e.
+
+    ./configure --with-db-type=MariaDB
+
+This is to install an old version of "DBD::mysql" that still supports MariaDB.
+We plan to switch to "DBD::MariaDB" in the future when it's fully compatible
+with RT.
diff --git a/README.MySQL b/README.MySQL
index 3011f59f4e..d86df50096 100644
--- a/README.MySQL
+++ b/README.MySQL
@@ -1,3 +1,5 @@
+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
@@ -61,3 +63,19 @@ settings. For more information:
 
 https://stackoverflow.com/a/41148052
 https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-sets.html
+
+MYSQL 5.7
+---------
+
+MySQL 5.7 is end of life, if you are still running it, please specify
+"--with-db-type=mysql5" when running "configure" method, i.e.
+
+    ./configure --with-db-type=mysql5
+
+This is to install an old version of "DBD::mysql" that still supports it.
+
+MYSQL 8
+-------
+
+If MySQL 8 hasn't been added to your OS package system, you may need to add
+MySQL repository directly: https://dev.mysql.com/downloads/
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/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


More information about the rt-commit mailing list