diff --git a/.gitignore b/.gitignore
index 2b032ad..6865ad2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-SOURCES/mariadb-10.3.39.tar.gz
+SOURCES/fmt-11.0.2.zip
+SOURCES/mariadb-10.11.10.tar.gz
diff --git a/.mariadb.metadata b/.mariadb.metadata
index 81ef032..9e21c8d 100644
--- a/.mariadb.metadata
+++ b/.mariadb.metadata
@@ -1 +1,2 @@
-25972d22ed05249782141392f0893e71c7d549a9 SOURCES/mariadb-10.3.39.tar.gz
+bca4fc0ca0cff346ac2a77a3ae02c415c0e1fce6 SOURCES/fmt-11.0.2.zip
+2c81ce8aa391470435bf613a5c8ee0aa98b8b1b1 SOURCES/mariadb-10.11.10.tar.gz
diff --git a/SOURCES/mariadb-10.3.39-tests.patch b/SOURCES/mariadb-10.3.39-tests.patch
deleted file mode 100644
index 54f5ff9..0000000
--- a/SOURCES/mariadb-10.3.39-tests.patch
+++ /dev/null
@@ -1,101 +0,0 @@
---- mariadb-10.3.39/mysql-test/include/default_mysqld.cnf	2023-05-03 06:32:44.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/include/default_mysqld.cnf	2023-07-07 13:58:40.255283041 +0200
-@@ -127,3 +127,8 @@ local-infile
- # tables.  Let's enable it in the [server] group, because this group
- # is read after [mysqld] and [embedded]
- loose-aria
-+
-+[mysqltest]
-+loose-ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
-+loose-ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
-+loose-ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
-
---- mariadb-10.3.39/mysql-test/include/wait_until_connected_again.inc	2023-05-03 06:32:44.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/include/wait_until_connected_again.inc	2023-07-07 13:55:30.424368106 +0200
-@@ -11,7 +11,7 @@ let $counter= 5000;
- let $mysql_errno= 9999;
- while ($mysql_errno)
- {
--  --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013
-+  --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013,2026
-   show status;
- 
-   dec $counter;
-
---- mariadb-10.3.39/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test	2023-05-03 06:32:45.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test	2023-07-07 13:54:31.152082427 +0200
-@@ -53,7 +53,7 @@ insert into t4 values (3),(4);
- connection master;
- # The get_lock function causes warning for unsafe statement.
- --disable_warnings
----error 0,1317,2013
-+--error 0,1317,2013,2026
- reap;
- --enable_warnings
- connection master1;
-
---- mariadb-10.3.39/mysql-test/suite/innodb/t/innodb_bug51920.test	2023-05-03 06:32:44.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/suite/innodb/t/innodb_bug51920.test	2023-07-07 15:11:39.000404508 +0200
-@@ -36,7 +36,7 @@ let $wait_condition =
- # depending on platform.
- #
- connection con1;
---- error 1317, 2006, 2013, ER_CONNECTION_KILLED
-+-- error 1317, 2006, 2013, 2026, ER_CONNECTION_KILLED
- reap;
- connection default;
- DROP TABLE bug51920;
-
---- mariadb-10.3.39/mysql-test/main/lock_kill.test	2023-05-03 06:32:44.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/main/lock_kill.test	2023-07-07 15:13:54.335086789 +0200
-@@ -17,7 +17,7 @@ LOCK TABLE t1 WRITE;
- eval KILL $conid;
- --enable_query_log
- --connection con1
----error 0,2006,2013,ER_CONNECTION_KILLED
-+--error 0,2006,2013,2026,ER_CONNECTION_KILLED
- reap;
- --connection default
- --disconnect con1
-@@ -35,7 +35,7 @@ LOCK TABLE t1 WRITE, t2 WRITE;
- eval KILL $conid;
- --enable_query_log
- --connection con1
----error 0,2006,2013,ER_CONNECTION_KILLED
-+--error 0,2006,2013,2026,ER_CONNECTION_KILLED
- reap;
- --connection default
- --disconnect con1
-
---- mariadb-10.3.39/mysql-test/main/loadxml.test	2023-05-03 06:32:44.000000000 +0200
-+++ ../../mariadb-10.3.39/mysql-test/main/loadxml.test	2023-07-07 15:15:14.862492763 +0200
-@@ -83,7 +83,7 @@ connection default;
- connection addconroot;
- # Read response from connection to avoid packets out-of-order when disconnecting
- # Note, that connection can already be dead due to previously issued kill
----error 0,2013
-+--error 0,2013,2026
- --reap
- disconnect addconroot;
- connection default;
-
---- mariadb-10.3.39/plugin/disks/mysql-test/disks/disks.test	2023-05-03 06:32:45.000000000 +0200
-+++ ../../mariadb-10.3.39/plugin/disks/mysql-test/disks/disks.test	2023-07-10 11:48:28.859497746 +0200
-@@ -1,3 +1,3 @@
- --replace_regex /varchar\([0-9]+\)/varchar(pathlen)/
- show create table information_schema.disks;
--select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
-+select sum(Total) >= sum(Available), sum(Total) >= sum(Used) from information_schema.disks;
-
---- mariadb-10.3.39/plugin/disks/mysql-test/disks/disks.result	2023-05-03 06:32:45.000000000 +0200
-+++ ../../mariadb-10.3.39/plugin/disks/mysql-test/disks/disks.result	2023-07-10 12:47:10.460233056 +0200
-@@ -7,6 +7,6 @@ DISKS	CREATE TEMPORARY TABLE `DISKS` (
-   `Used` bigint(32) NOT NULL,
-   `Available` bigint(32) NOT NULL
- ) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
--select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
--sum(Total) > sum(Available)	sum(Total)>sum(Used)
-+select sum(Total) >= sum(Available), sum(Total) >= sum(Used) from information_schema.disks;
-+sum(Total) >= sum(Available)	sum(Total) >= sum(Used)
- 1	1
-
diff --git a/SOURCES/mariadb-annocheck.patch b/SOURCES/mariadb-annocheck.patch
deleted file mode 100644
index 223619d..0000000
--- a/SOURCES/mariadb-annocheck.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Harden the "hardened" flags even more to comply with RHEL8 security rules
-
---- mariadb-10.3.25/CMakeLists.txt	2020-10-05 18:19:45.000000000 +0200
-+++ mariadb-10.3.25/CMakeLists.txt_patched	2020-11-03 01:29:52.369426705 +0100
-@@ -247,7 +247,7 @@ IF(NOT WITH_TSAN)
-     # security-enhancing flags
-     MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
-     MY_CHECK_AND_SET_LINKER_FLAG("-Wl,-z,relro,-z,now")
--    MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
-+    MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector-strong --param=ssp-buffer-size=4")
-     MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
-   ENDIF()
- ENDIF()
diff --git a/SOURCES/mariadb-auth_pam_tool_dir.patch b/SOURCES/mariadb-auth_pam_tool_dir.patch
new file mode 100644
index 0000000..b82f4d8
--- /dev/null
+++ b/SOURCES/mariadb-auth_pam_tool_dir.patch
@@ -0,0 +1,29 @@
+This scirpt is ran by the systemd service.
+In Fedora the service has priviledges dropped to the mysql user.
+Thus "chown 0" will always fail
+
+Never parse 'ls' output!
+http://mywiki.wooledge.org/BashFAQ/087
+
+--- mariadb-10.4.12/scripts/mysql_install_db.sh	2020-01-26 21:43:53.000000000 +0100
++++ mariadb-10.4.12/scripts/mysql_install_db.sh_patched	2020-01-29 11:11:09.448812331 +0100
+@@ -482,13 +482,16 @@ if test -n "$user"
+ then
+   if test -z "$srcdir" -a "$in_rpm" -eq 0 -a -d "$pamtooldir/auth_pam_tool_dir"
+   then
+-    chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
+-    chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
+-    if test $? -ne 0
++    if [ `stat "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" -c %u` -ne 0 ]
+     then
++      chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
++      chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
++      if test $? -ne 0
++      then
+         echo "Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'."
+         echo "It must be root, the PAM authentication plugin doesn't work otherwise.."
+         echo
++      fi
+     fi
+     chown $user "$pamtooldir/auth_pam_tool_dir" && \
+     chmod 0700 "$pamtooldir/auth_pam_tool_dir"
diff --git a/SOURCES/mariadb-libfmt.patch b/SOURCES/mariadb-libfmt.patch
new file mode 100644
index 0000000..58f1e63
--- /dev/null
+++ b/SOURCES/mariadb-libfmt.patch
@@ -0,0 +1,31 @@
+MariaDB upstream uses an old version (8.0) of the FMT library, unlike Fedora which packs a current one (10.2)
+  https://src.fedoraproject.org/rpms/fmt
+  https://github.com/MariaDB/server/blob/10.11/cmake/libfmt.cmake#L18
+
+There is a breaking change between the FMT library version 8 and 10.
+Sergei Golubchik from MariaDB upstream noticed that and  decided to not rebase to the newer version for now. In the same commit:
+  https://github.com/MariaDB/server/commit/b5c367cd88e37091ab5f8dab0396c01c97d037e2
+He also fixed the CMake file controlling the FMT library.
+It now correctly detects, whether the system version is able to compile a given code in an expected way.
+
+The incompatibility between FMT library version has been reported both agains Fedora and FMT upstream
+  https://bugzilla.redhat.com/show_bug.cgi?id=2266807
+The upstream created a patch and Fedora backported it
+  https://src.fedoraproject.org/rpms/fmt/c/7d6d6e2c33e845b3cbf3fcaf83f14dfeddfa8a70?branch=rawhide
+but only in F40 and later.
+
+To avoid potential issues on systems with FMT library between 8.0 and the one with the fix backported,
+introduce a bundling mechanism for use on such distributions.
+We pre-download the sources archive and supply the CMake with it, instead of the web URL.
+
+--- mariadb-10.11.10/cmake/libfmt.cmake	2024-10-29 15:32:31.000000000 +0100
++++ mariadb-10.11.10/cmake/libfmt.cmake_patched	2024-11-14 12:06:35.961435488 +0100
+@@ -15,7 +15,7 @@ MACRO(BUNDLE_LIBFMT)
+   ExternalProject_Add(
+     libfmt
+     PREFIX   "${dir}"
+-    URL      "https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip"
++    URL      "file:///${dir}/fmt-11.0.2.zip"
+     URL_MD5 c622dca45ec3fc95254c48370a9f7a1d
+     INSTALL_COMMAND ""
+     CONFIGURE_COMMAND ""
diff --git a/SOURCES/mariadb-logrotate.patch b/SOURCES/mariadb-logrotate.patch
index e3b7e7c..ec522b0 100644
--- a/SOURCES/mariadb-logrotate.patch
+++ b/SOURCES/mariadb-logrotate.patch
@@ -1,79 +1,32 @@
-Adjust the mysql-log-rotate script in several ways:
+Adjust the 'mariadb.logrotate.sh' script in several ways:
 
 * Use the correct log file pathname for Red Hat installations.
-* Enable creation of the log file by logrotate (needed since
-  /var/log/ isn't writable by mysql user); and set the same 640
-  permissions we normally use.
-* Comment out the actual rotation commands, so that user must edit
-  the file to enable rotation.  This is unfortunate, but the fact
-  that the script will probably fail without manual configuration
-  (to set a root password) means that we can't really have it turned
-  on by default.  Fortunately, in most configurations the log file
-  is low-volume and so rotation is not critical functionality.
 
-See discussions at RH bugs 799735, 547007
-* Note they are from Fedora 15 / 16
+* Remove Debian specific code
+  for the very unlikely, but possible scenario
+  in which the debian config file would exist.
 
-Update 3/2017
-* it would be big unexpected change for anyone upgrading, if we start shipping it now.
-  Maybe it is good candidate for shipping with MariaDB 10.2 ?
-* the 'mysqladmin flush logs' doesn´t guarantee, no entries are lost
-  during flushing, the operation is not atomic.
-  We should not ship it in that state
-
-Update 6/2018
-* the SIGHUP causes server to flush all logs. No password admin needed, the only constraint is
-  beeing able to send the SIGHUP to the process and read the mysqld pid file, which root can.
-* Submited as PR: https://github.com/MariaDB/server/pull/807
-
-Update 01/2022
-* added delaycompress option
-* see https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux
-
---- mariadb-10.3.32/support-files/mysql-log-rotate.sh	2022-01-14 17:03:27.000000000 +0100
-+++ mariadb-10.3.32/support-files/mysql-log-rotate.sh_patched	2022-01-17 15:07:54.205379672 +0100
-@@ -3,36 +3,22 @@
- # in the [mysqld] section as follows:
- #
- # [mysqld]
--# log-error=@localstatedir@/mysqld.log
--#
--# If the root user has a password you have to create a
--# /root/.my.cnf configuration file with the following
--# content:
--#
--# [mysqladmin]
--# password = <secret> 
--# user= root
--#
--# where "<secret>" is the password. 
--#
--# ATTENTION: This /root/.my.cnf should be readable ONLY
--# for root !
-+# log-error=@LOG_LOCATION@
+--- mariadb-10.11.6/support-files/mariadb.logrotate.sh	2023-11-08 16:51:43.000000000 +0100
++++ mariadb-10.11.6/support-files/mariadb.logrotate.sh_patched	2023-12-17 18:03:36.955861025 +0100
+@@ -6,7 +6,7 @@
+ # Read https://mariadb.com/kb/en/error-log/ to learn more about logging and
+ # https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/ about rotating logs.
  
--@localstatedir@/mysqld.log {
--        # create 600 mysql mysql
+-@localstatedir@/mysqld.log @localstatedir@/mariadb.log @logdir@/*.log {
 +@LOG_LOCATION@ {
-+        create 600 mysql mysql
-         su mysql mysql
-         notifempty
-         daily
-         rotate 3
-         missingok
-         compress
-+        delaycompress
-     postrotate
- 	# just if mysqld is really running
--	if test -x @bindir@/mysqladmin && \
--	   @bindir@/mysqladmin ping &>/dev/null
--	then
--	   @bindir@/mysqladmin --local flush-error-log \
--              flush-engine-log flush-general-log flush-slow-log
--	fi
-+        if [ -e @PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid ]
-+        then
-+           kill -1 $(<@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid)
-+        fi
-     endscript
- }
+ 
+   # Depends on a mysql@localhost unix_socket authenticated user with RELOAD privilege
+   @su_user@
+@@ -45,11 +45,6 @@
+   # has thanks to the default use of Unix socket authentication for the 'mysql'
+   # (or root on Debian) account used everywhere since MariaDB 10.4.
+   postrotate
+-    if test -r /etc/mysql/debian.cnf
+-    then
+-      EXTRAPARAM='--defaults-file=/etc/mysql/debian.cnf'
+-    fi
+-
+     if test -x @bindir@/mariadb-admin
+     then
+       @bindir@/mariadb-admin $EXTRAPARAM --local flush-error-log \
+
diff --git a/SOURCES/mariadb-mdev-30402.patch b/SOURCES/mariadb-mdev-30402.patch
deleted file mode 100644
index 069bf76..0000000
--- a/SOURCES/mariadb-mdev-30402.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- mariadb-10.3.39/scripts/wsrep_sst_mariabackup.sh	2023-08-11 11:31:40.415022889 +0200
-+++ ../../mariadb-10.3.39/scripts/wsrep_sst_mariabackup.sh	2023-08-11 11:32:01.924161077 +0200
-@@ -340,6 +340,9 @@ get_transfer()
-                         "Use workaround for socat $SOCAT_VERSION bug"
-                 fi
-             fi
-+            if check_for_version "$SOCAT_VERSION" '1.7.4'; then
-+                tcmd="$tcmd,no-sni=1"
-+            fi
-         fi
- 
-         if [ "${sockopt#*,dhparam=}" = "$sockopt" ]; then
diff --git a/SOURCES/mariadb-mtr.patch b/SOURCES/mariadb-mtr.patch
new file mode 100644
index 0000000..592f73c
--- /dev/null
+++ b/SOURCES/mariadb-mtr.patch
@@ -0,0 +1,70 @@
+diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
+index 594e052a16e..6a274b2d597 100755
+--- a/mysql-test/mariadb-test-run.pl
++++ b/mysql-test/mariadb-test-run.pl
+@@ -1491,7 +1491,6 @@ sub command_line_setup {
+       mtr_warning ("Port base $opt_port_base rounded down to multiple of 10");
+       $opt_port_base-= $rem;
+     }
+-    $opt_build_thread= $opt_port_base / 10 - 1000;
+   }
+ 
+   # --------------------------------------------------------------------------
+@@ -1719,11 +1718,6 @@ sub command_line_setup {
+ # an environment variable can be used to control all ports. A small
+ # number is to be used, 0 - 16 or similar.
+ #
+-# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
+-# versions of this script, else a 4.0 test run might conflict with a
+-# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
+-# all port numbers might not be used in this version of the script.
+-#
+ # Also note the limitation of ports we are allowed to hand out. This
+ # differs between operating systems and configuration, see
+ # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
+@@ -1734,10 +1728,14 @@ sub set_build_thread_ports($) {
+ 
+   if ( lc($opt_build_thread) eq 'auto' ) {
+     my $found_free = 0;
+-    $build_thread = 300;	# Start attempts from here
+-    my $build_thread_upper = $build_thread + ($opt_parallel > 1500
+-                                              ? 3000
+-                                              : 2 * $opt_parallel) + 300;
++    if ($opt_port_base eq "auto") {
++      $build_thread = 15000;
++    } else {
++      $build_thread = $opt_port_base;
++    }
++    $build_thread += ($thread - 1) * $opt_port_group_size;
++    my $build_thread_upper = $build_thread + $opt_parallel * 2;
++
+     while (! $found_free)
+     {
+       $build_thread= mtr_get_unique_id($build_thread, $build_thread_upper);
+@@ -1754,7 +1752,7 @@ sub set_build_thread_ports($) {
+   }
+   else
+   {
+-    $build_thread = $opt_build_thread + $thread - 1;
++    $build_thread = $opt_port_base + $thread - 1;
+     if (! check_ports_free($build_thread)) {
+       # Some port was not free(which one has already been printed)
+       mtr_error("Some port(s) was not free")
+@@ -1763,7 +1761,7 @@ sub set_build_thread_ports($) {
+   $ENV{MTR_BUILD_THREAD}= $build_thread;
+ 
+   # Calculate baseport
+-  $baseport= $build_thread * $opt_port_group_size + 10000;
++  $baseport= $build_thread;
+   if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
+   {
+     mtr_error("MTR_BUILD_THREAD number results in a port",
+@@ -2968,7 +2966,7 @@ sub kill_leftovers ($) {
+ sub check_ports_free ($)
+ {
+   my $bthread= shift;
+-  my $portbase = $bthread * $opt_port_group_size + 10000;
++  my $portbase = $bthread;
+   for ($portbase..$portbase+($opt_port_group_size-1)){
+     if (mtr_ping_port($_)){
+       mtr_report(" - 'localhost:$_' was not free");
diff --git a/SOURCES/mariadb-ownsetup.patch b/SOURCES/mariadb-ownsetup.patch
index 3534c43..7728cf1 100644
--- a/SOURCES/mariadb-ownsetup.patch
+++ b/SOURCES/mariadb-ownsetup.patch
@@ -1,16 +1,14 @@
-diff -up mariadb-10.1.8/support-files/CMakeLists.txt.p9 mariadb-10.1.8/support-files/CMakeLists.txt
---- mariadb-10.2.32/support-files/CMakeLists.txt	2020-05-08 13:45:27.000000000 +0200
-+++ mariadb-10.2.32/support-files/CMakeLists.txt_pacthed	2020-05-13 10:11:30.884190396 +0200
-@@ -100,7 +100,8 @@ IF(UNIX)
-   ENDIF()
- 
-   CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
--  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_LIBDIR}/pkgconfig COMPONENT Development)
-+  CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY)
-+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
- 
-   INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
-   
+--- mariadb-10.4.14/support-files/CMakeLists.txt	2020-08-06 17:28:28.000000000 +0200
++++ mariadb-10.4.14/support-files/CMakeLists.txt_patched	2020-09-03 13:21:07.826658279 +0200
+@@ -187,6 +187,7 @@ IF(UNIX)
+               COMPONENT SharedLibraries)
+       INSTALL(FILES rpm/mysql-clients.cnf DESTINATION ${INSTALL_SYSCONF2DIR}
+               COMPONENT Client)
++      CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_SOURCE_DIR}/rpm/server.cnf @ONLY)
+       INSTALL(FILES rpm/server.cnf DESTINATION ${INSTALL_SYSCONF2DIR}
+               COMPONENT IniFiles)
+       INSTALL(FILES rpm/enable_encryption.preset DESTINATION ${INSTALL_SYSCONF2DIR}
+
 diff -up mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup mariadb-10.0.15/support-files/rpm/server.cnf
 --- mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup	2015-01-24 23:55:55.110063592 +0100
 +++ mariadb-10.0.15/support-files/rpm/server.cnf	2015-01-24 23:57:42.308114387 +0100
diff --git a/SOURCES/mariadb-pcdir.patch b/SOURCES/mariadb-pcdir.patch
deleted file mode 100644
index d9a8a78..0000000
--- a/SOURCES/mariadb-pcdir.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Use PCDIR CMake option, if configured
-
-Upstream install the server pkgconfig file into arch-independent directory
-Reported to upstream as: https://jira.mariadb.org/browse/MDEV-14340
-
---- mariadb-10.3.12/support-files/CMakeLists.txt	2019-03-20 15:25:53.423283135 +0100
-+++ mariadb-10.3.12/support-files/CMakeLists.txt_patched	2019-03-20 15:38:56.372819958 +0100
-@@ -82,7 +82,12 @@ IF(UNIX)
- 
-   CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
-   CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY)
-+IF(INSTALL_PCDIR)
-+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_PCDIR} COMPONENT Development)
-+ELSE()
-   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
-+ENDIF()
-+
- 
-   INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
-   
diff --git a/SOURCES/mariadb-scripts.patch b/SOURCES/mariadb-scripts.patch
index b684482..74914b1 100644
--- a/SOURCES/mariadb-scripts.patch
+++ b/SOURCES/mariadb-scripts.patch
@@ -1,11 +1,12 @@
 We have some downstream patches and other scripts that include variables to
 be expanded by cmake. Cmake needs to know about them, so adding them manually.
 
---- mariadb-10.3.8/scripts/CMakeLists.txt	2018-07-02 09:34:11.000000000 +0200
-+++ mariadb-10.3.8/scripts/CMakeLists.txt_patched	2018-07-03 10:58:15.954670153 +0200
-@@ -361,6 +361,34 @@ ELSE()
-       COMPONENT ${${file}_COMPONENT}
-      )
+ # Install libgcc as  mylibgcc.a
+--- mariadb-10.5.5/scripts/CMakeLists.txt.old	2020-09-24 10:13:35.272589689 +0200
++++ mariadb-10.5.5/scripts/CMakeLists.txt	2020-09-24 10:17:31.428985798 +0200
+@@ -377,6 +377,34 @@
+       INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT})
+     ENDIF()
    ENDFOREACH()
 +
 +  # files for systemd
diff --git a/SOURCES/mariadb-ssl-cipher-tests.patch b/SOURCES/mariadb-ssl-cipher-tests.patch
new file mode 100644
index 0000000..567e433
--- /dev/null
+++ b/SOURCES/mariadb-ssl-cipher-tests.patch
@@ -0,0 +1,13 @@
+diff -up mariadb-10.3.9/mysql-test/main/ssl_cipher.test.fixtest mariadb-10.3.9/mysql-test/main/ssl_cipher.test
+--- mariadb-10.3.13/mysql-test/main/ssl_cipher.test	2019-02-20 08:59:09.000000000 +0100
++++ mariadb-10.3.13/mysql-test/main/ssl_cipher.test_patched	2019-02-22 11:22:01.250256060 +0100
+@@ -97,7 +97,9 @@ drop user mysqltest_1@localhost;
+ let $restart_parameters=--ssl-cipher=AES128-SHA;
+ source include/restart_mysqld.inc;
+ connect (ssl_con,localhost,root,,,,,SSL);
++--replace_regex /TLS_AES_.*/AES128-SHA/
+ SHOW STATUS LIKE 'Ssl_cipher';
++--replace_regex /TLS_AES_.*/AES128-SHA/
+ SHOW STATUS LIKE 'Ssl_cipher_list';
+ disconnect ssl_con;
+ connection default;
diff --git a/SOURCES/rh-skipped-tests-arm.list b/SOURCES/rh-skipped-tests-arm.list
index c3b5ced..b6b609e 100644
--- a/SOURCES/rh-skipped-tests-arm.list
+++ b/SOURCES/rh-skipped-tests-arm.list
@@ -1,3 +1,2 @@
-# Fails on aarch64
-innodb.innodb_buffer_pool_resize :
-innodb.innodb_buffer_pool_resize_with_chunks :
+# Fails since 10.11.10
+main.mysql_client_test_nonblock :
diff --git a/SOURCES/rh-skipped-tests-base.list b/SOURCES/rh-skipped-tests-base.list
index 6b720f4..275e012 100644
--- a/SOURCES/rh-skipped-tests-base.list
+++ b/SOURCES/rh-skipped-tests-base.list
@@ -1,27 +1,97 @@
-# Fails everywhere
-innodb.innodb_defrag_binlog :
+# The SSL test are failing correctly. Fro more explanation, see:
+# https://jira.mariadb.org/browse/MDEV-8404?focusedCommentId=84275&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-84275
+main.ssl_7937                                : #1399847
+main.ssl_8k_key                              :
+main.ssl_crl                                 : #1399847
 
-main.ssl_7937 :
-main.ssl_8k_key :
-main.ssl_crl :
-main.ssl_system_ca :
-main.userstat :
+# ------------------------------
+# Tests that fails because of 'Self Signed Certificate in the Certificate Chain'
+perfschema.cnf_option                        :
 
-perfschema.cnf_option :
-perfschema.nesting :
+rpl.rpl_row_img_blobs                        :
+rpl.rpl_row_img_eng_min                      :
+rpl.rpl_row_img_eng_noblob                   :
+
+sys_vars.slave_parallel_threads_basic        :
+
+# ------------------------------
+# Expected to fail, the plugin is not build with server, but 'mariadb-connector-c' instead
+plugins.auth_ed25519                         :
+plugins.multiauth                            :
+
+# ------------------------------
+perfschema.nesting                           : #1399847
+perfschema.socket_summary_by_instance_func   : #1399847
 perfschema.socket_summary_by_event_name_func :
-perfschema.socket_summary_by_instance_func :
 
-plugins.feedback_plugin_load :
+# ------------------------------
+# Fails since 10.1.12
+innodb.innodb_defrag_binlog                  :
 
-rpl.rpl_row_img_blobs :
-rpl.rpl_row_img_eng_min :
-rpl.rpl_row_img_eng_noblob :
+# Fails everywhere since 10.2.15
+main.userstat                                :
 
-sys_vars.slave_parallel_threads_basic :
+# Fails everywhere since 10.4.11
+sys_vars.tcp_nodelay                         :
 
-# Fails only on i686
-main.myisampack :
+# Fails since 10.5.2
+disks.disks                                  :
+disks.disks_notembedded                      :
 
-# We don't build the plugin in server; we build it in mariadb-connector-c instead
-plugins.auth_ed25519 :
\ No newline at end of file
+# Fails since 10.5.3
+main.mysqld--help-aria                       :
+
+# Fails since 10.5.7
+plugins.feedback_plugin_load                 :
+
+# Fails on all architectures since 10.5.18
+main.information_schema                      :
+main.loadxml                                 :
+main.lock_kill                               :
+
+# Fails since 10.5.20
+binlog_encryption.rpl_cant_read_event_incident :
+rpl.rpl_report_port                         :
+rpl.rpl_reset_slave_fail                    :
+rpl.rpl_xa_survive_disconnect_lsu_off       :
+rpl.rpl_heartbeat_basic                     :
+rpl.rpl_xa_survive_disconnect               :
+rpl.rpl_err_ignoredtable                    :
+
+# ------------------------------
+# Fails on 10.11.6
+binlog_encryption.rpl_gtid_basic             :
+main.mysqld--help-aria                       :
+main.plugin_auth                             :
+mariabackup.encrypted_page_corruption        :
+multi_source.info_logs                       :
+oqgraph.regression_mdev6345                  :
+perfschema.threads_mysql                     :
+type_test.type_test_double                   :
+
+rpl.rpl_cant_read_event_incident             :
+rpl.rpl_change_master_demote                 :
+rpl.rpl_domain_id_filter_restart             :
+rpl.rpl_gtid_basic                           :
+rpl.rpl_mdev6020                             :
+rpl.rpl_old_master                           :
+rpl.rpl_perfschema_applier_status_by_coordinator :  
+rpl.rpl_rewrite_db_sys_vars                  :
+rpl.rpl_semi_sync_wait_point                 :
+rpl.rpl_trigger                              :
+rpl.rpl_upgrade_master_info                  :
+
+# Unstable on 10.11.6
+rpl.rpl_slave_shutdown_mdev20821             :
+
+# Fails on 10.11.9
+main.mdev375                                 :
+perfschema.show_aggregate                    :
+
+# Unstable on 10.11.9
+innodb.log_file_size_online                  :
+
+# Fails on all architectures since  10.11.10
+main.connect                                 :
+main.timezone                                :
+innodb.log_file_name                         :
diff --git a/SOURCES/rh-skipped-tests-ppc.list b/SOURCES/rh-skipped-tests-ppc.list
index 1938180..e69de29 100644
--- a/SOURCES/rh-skipped-tests-ppc.list
+++ b/SOURCES/rh-skipped-tests-ppc.list
@@ -1,30 +0,0 @@
-# Fails on ppc64le
-parts.partition_alter1_1_innodb :
-parts.partition_alter1_2_innodb : 
-parts.partition_alter1_1_2_innodb :
-parts.partition_alter1_2_1_innodb :
-parts.partition_alter2_1_1_innodb : 
-parts.partition_alter1_2_2_innodb : 
-parts.partition_alter2_1_2_innodb : 
-parts.partition_alter2_2_1_innodb : 
-parts.partition_alter2_2_2_innodb : 
-parts.partition_alter4_innodb : 
-parts.partition_basic_innodb :
-parts.part_supported_sql_func_innodb :
-
-rpl.rpl_loaddata_m :
-
-#
-stress.ddl_innodb :
-
-innodb.innodb_buffer_pool_resize :
-innodb.innodb_buffer_pool_resize_with_chunks :
-innodb.innodb_bulk_create_index :
-innodb.innodb_defrag_binlog :
-innodb.innodb_defrag_concurrent :
-innodb_gis.kill_server :
-gcol.innodb_virtual_basic :
-
-# Unstable (randomly failing) tests
-innodb_gis.rtree_search :
-main.type_ranges :
diff --git a/SOURCES/rh-skipped-tests-s390.list b/SOURCES/rh-skipped-tests-s390.list
index 96f893a..a502519 100644
--- a/SOURCES/rh-skipped-tests-s390.list
+++ b/SOURCES/rh-skipped-tests-s390.list
@@ -1,8 +1,12 @@
-# Fails on s390x
-disks.disks :
-disks.disks_notembedded :
+# Fails on 10.11.6
+main.func_json_notembedded :
+mariabackup.huge_lsn :
+mariabackup.xb_file_key_management :
+main.column_compression_parts :
 
-# related to MDEV-20194
-# first check of `undefined` table causes warning,
-# instead INSERT and ALTER should cause it
-innodb.row_size_error_log_warnings_3 :
+# Fails on 10.11.9
+main.having_cond_pushdown :
+mariabackup.slave_provision_nolock :
+mariabackup.page_compression_level :
+mariabackup.xb_page_compress :
+innodb.101_compatibility :
diff --git a/SOURCES/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch b/SOURCES/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch
new file mode 100644
index 0000000..effd1fe
--- /dev/null
+++ b/SOURCES/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch
@@ -0,0 +1,1066 @@
+From 5cc2096f93b7f130b36f8bc0fc43440db9a848e4 Mon Sep 17 00:00:00 2001
+From: Pali <pali@cpan.org>
+Date: Fri, 7 Jun 2019 16:30:27 +0200
+Subject: [PATCH] Switch Perl DBI scripts from DBD::mysql to DBD::MariaDB
+ driver
+
+Perl DBD::MariaDB driver is available CPAN and is already used in
+production environment.
+---
+ Docs/INSTALL-BINARY                           |  2 +-
+ man/mysql_convert_table_format.1              |  2 +-
+ man/mysql_setpermission.1                     |  2 +-
+ ...dbd-mysql.inc => have_dbi_dbd-mariadb.inc} | 10 ++--
+ mysql-test/include/mysqlhotcopy.inc           |  4 +-
+ ...I_DBD-mysql.pl => checkDBI_DBD-MariaDB.pl} | 26 ++++----
+ plugin/handler_socket/client/hspool_test.pl   |  4 +-
+ plugin/handler_socket/client/hstest.pl        |  4 +-
+ .../handler_socket/regtest/common/hstest.pm   |  8 +--
+ scripts/mysql_convert_table_format.sh         |  4 +-
+ scripts/mysql_setpermission.sh                |  2 +-
+ scripts/mysqlhotcopy.sh                       |  8 +--
+ scripts/mytop.sh                              |  6 +-
+ sql-bench/server-cfg.sh                       |  4 +-
+ storage/maria/ma_ft_test1.h                   |  2 +-
+ tests/big_record.pl                           |  6 +-
+ tests/check_async_queries.pl                  |  2 +-
+ tests/consistent_snapshot.pl                  |  2 +-
+ tests/drop_test.pl                            | 12 ++--
+ tests/fork_big.pl                             | 28 ++++-----
+ tests/fork_big2.pl                            | 32 +++++-----
+ tests/grant.pl                                |  4 +-
+ tests/index_corrupt.pl                        | 10 ++--
+ tests/insert_and_repair.pl                    | 10 ++--
+ tests/mail_to_db.pl                           |  6 +-
+ tests/pmail.pl                                |  2 +-
+ tests/rename_test.pl                          | 12 ++--
+ tests/test_delayed_insert.pl                  | 22 +++----
+ tests/truncate.pl                             |  6 +-
+ 35 files changed, 161 insertions(+), 166 deletions(-)
+ rename mysql-test/include/{have_dbi_dbd-mysql.inc => have_dbi_dbd-mariadb.inc} (91%)
+ rename mysql-test/std_data/{checkDBI_DBD-mysql.pl => checkDBI_DBD-MariaDB.pl} (80%)
+
+diff --git a/Docs/INSTALL-BINARY b/Docs/INSTALL-BINARY
+index 2bd6daaea17c..64d5192a49dd 100644
+--- a/Docs/INSTALL-BINARY
++++ b/Docs/INSTALL-BINARY
+@@ -154,7 +154,7 @@ shell> chown -R mysql data
+        script itself and at
+        https://mariadb.com/kb/en/starting-and-stopping-mariadb-automatically.
+    10. You can set up new accounts using the bin/mysql_setpermission
+-       script if you install the DBI and DBD::mysql Perl modules. See
++       script if you install the DBI and DBD::MariaDB Perl modules. See
+        Section 4.6.14, "mysql_setpermission --- Interactively Set
+        Permissions in Grant Tables." For Perl module installation
+        instructions, see Section 2.15, "Perl Installation Notes."
+diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1
+index 0c35c2954192..faa35afbe560 100644
+--- a/man/mysql_convert_table_format.1
++++ b/man/mysql_convert_table_format.1
+@@ -26,7 +26,7 @@ by default)\&.
+ is written in Perl and requires that the
+ DBI
+ and
+-DBD::mysql
++DBD::MariaDB
+ Perl modules be installed (see
+ Section\ \&2.15, \(lqPerl Installation Notes\(rq)\&.
+ .PP
+diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1
+index f20f7ceff358..f2f5e3e039c8 100644
+--- a/man/mysql_setpermission.1
++++ b/man/mysql_setpermission.1
+@@ -25,7 +25,7 @@ is a Perl script that was originally written and contributed by Luuk de Boer\&.
+ is written in Perl and requires that the
+ DBI
+ and
+-DBD::mysql
++DBD::MariaDB
+ Perl modules be installed\&.
+ .PP
+ Invoke
+diff --git a/mysql-test/include/have_dbi_dbd-mysql.inc b/mysql-test/include/have_dbi_dbd-mariadb.inc
+similarity index 91%
+rename from mysql-test/include/have_dbi_dbd-mysql.inc
+rename to mysql-test/include/have_dbi_dbd-mariadb.inc
+index 7c2113a8109b..1495d2891c8a 100644
+--- a/mysql-test/include/have_dbi_dbd-mysql.inc
++++ b/mysql-test/include/have_dbi_dbd-mariadb.inc
+@@ -1,7 +1,7 @@
+ #
+ # Originally created by John Embretsen, 2011-01-26.
+ #
+-# Checks for the existence of Perl modules DBI and DBD::mysql as seen from the
++# Checks for the existence of Perl modules DBI and DBD::MariaDB as seen from the
+ # perl installation used by "external" executable perl scripts, i.e. scripts
+ # that are executed as standalone scripts interpreted by the perl installation
+ # specified by the "shebang" line in the top of these scripts.
+@@ -30,7 +30,7 @@
+ # We jump through some hoops since there is no direct way to check if an 
+ # external command went OK or not from a mysql-test file:
+ #
+-#   - In theory, we could do as simple as "exec perl -MDBI -MDBD::mysql -e 1",
++#   - In theory, we could do as simple as "exec perl -MDBI -MDBD::MariaDB -e 1",
+ #     however we cannot check the result (exit code) from within a test script. 
+ #     Also, this may not yield the same result as other uses of perl due to the 
+ #     shebang issue mentioned above.
+@@ -55,8 +55,8 @@
+ # Instead, we call a separate helper script which checks for the modules in its
+ # own environment. We call it without "perl" in front.
+ 
+---let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
+---let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
++--let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-MariaDB.pl
++--let $resultFile= $MYSQL_TMP_DIR/dbiDBD-MariaDB.txt
+ 
+ --exec perl $perlChecker
+ 
+@@ -64,7 +64,7 @@
+ --source $resultFile
+ 
+ if (!$dbidbd) {
+-    --skip Test needs Perl modules DBI and DBD::mysql
++    --skip Test needs Perl modules DBI and DBD::MariaDB
+ } 
+ 
+ # Clean up
+diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
+index 2fc14d599d94..306f0acc2084 100644
+--- a/mysql-test/include/mysqlhotcopy.inc
++++ b/mysql-test/include/mysqlhotcopy.inc
+@@ -4,7 +4,7 @@
+ 
+ --source include/not_windows.inc
+ --source include/not_embedded.inc
+---source include/have_dbi_dbd-mysql.inc
++--source include/have_dbi_dbd-mariadb.inc
+ 
+ if (!$MYSQLHOTCOPY)
+ {
+@@ -19,7 +19,7 @@ if (!$MYSQLHOTCOPY)
+ #       executable, i.e. not necessarily using the perl interpreter in PATH,
+ #       because that is how the documentation demonstrates it.
+ #
+-#       We include have_dbi_dbd-mysql.inc above so that the test will
++#       We include have_dbi_dbd-mariadb.inc above so that the test will
+ #       be skipped if Perl modules required by the mysqlhotcopy tool are not
+ #       found when the script is run this way.
+ 
+diff --git a/mysql-test/std_data/checkDBI_DBD-mysql.pl b/mysql-test/std_data/checkDBI_DBD-MariaDB.pl
+similarity index 80%
+rename from mysql-test/std_data/checkDBI_DBD-mysql.pl
+rename to mysql-test/std_data/checkDBI_DBD-MariaDB.pl
+index 328a7ad774f3..ed0f5b415d7a 100755
+--- a/mysql-test/std_data/checkDBI_DBD-mysql.pl
++++ b/mysql-test/std_data/checkDBI_DBD-MariaDB.pl
+@@ -20,7 +20,7 @@
+ ################################################################################
+ #
+ # This perl script checks for availability of the Perl modules DBI and
+-# DBD::mysql using the "current" perl interpreter.
++# DBD::MariaDB using the "current" perl interpreter.
+ #
+ # Useful for test environment checking before testing executable perl scripts
+ # in the MySQL Server distribution.
+@@ -30,8 +30,8 @@
+ #       support running perl scripts with such a shebang without specifying the
+ #       perl interpreter on the command line. Such a script is mysqlhotcopy.
+ #
+-#       When run as "checkDBI_DBD-mysql.pl" the shebang line will be evaluated
+-#       and used. When run as "perl checkDBI_DBD-mysql.pl" the shebang line is
++#       When run as "checkDBI_DBD-MariaDB.pl" the shebang line will be evaluated
++#       and used. When run as "perl checkDBI_DBD-MariaDB.pl" the shebang line is
+ #       not used.
+ #
+ # NOTE: This script will create a temporary file in MTR's tmp dir.
+@@ -43,13 +43,13 @@
+ #
+ #       Example:
+ #
+-#         --let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
+-#         --let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
++#         --let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-MariaDB.pl
++#         --let $resultFile= $MYSQL_TMP_DIR/dbiDBD-MariaDB.txt
+ #         --chmod 0755 $perlChecker
+ #         --exec $perlChecker
+ #         --source $resultFile
+ #         if (!$dbidbd) {
+-#             --skip Test needs Perl modules DBI and DBD::mysql
++#             --skip Test needs Perl modules DBI and DBD::MariaDB
+ #         } 
+ #
+ #       The calling script is also responsible for cleaning up after use:
+@@ -59,7 +59,7 @@
+ # Windows notes: 
+ #   - shebangs may work differently - call this script with "perl " in front.
+ #
+-# See mysql-test/include/have_dbi_dbd-mysql.inc for example use of this script.
++# See mysql-test/include/have_dbi_dbd-mariadb.inc for example use of this script.
+ # This script should be executable for the user running MTR.
+ #
+ ################################################################################
+@@ -69,13 +69,13 @@ BEGIN
+     # We need to catch "Can't locate" as well as "Can't load" errors.
+     eval{
+         $FOUND_DBI=0;
+-        $FOUND_DBD_MYSQL=0;
++        $FOUND_DBD_MARIADB=0;
+ 
+         # Check for DBI module:
+         $FOUND_DBI=1 if require DBI;
+ 
+-        # Check for DBD::mysql module
+-        $FOUND_DBD_MYSQL=1 if require DBD::mysql;
++        # Check for DBD::MariaDB module
++        $FOUND_DBD_MARIADB=1 if require DBD::MariaDB;
+     };
+ };
+ 
+@@ -83,11 +83,11 @@ BEGIN
+ # The file must be created whether we write to it or not, otherwise mysql-test 
+ # will complain if trying to source it. 
+ # An empty file indicates failure to load modules.
+-open(FILE, ">", $ENV{'MYSQL_TMP_DIR'}.'/dbidbd-mysql.txt');
++open(FILE, ">", $ENV{'MYSQL_TMP_DIR'}.'/dbiDBD-MariaDB.txt');
+ 
+-if ($FOUND_DBI && $FOUND_DBD_MYSQL) {
++if ($FOUND_DBI && $FOUND_DBD_MARIADB) {
+     # write a mysql-test command setting a variable to indicate success
+-    print(FILE 'let $dbidbd= FOUND_DBI_DBD-MYSQL;'."\n");
++    print(FILE 'let $dbidbd= FOUND_DBI_DBD-MARIADB;'."\n");
+ }
+ 
+ # close the file.
+diff --git a/plugin/handler_socket/client/hspool_test.pl b/plugin/handler_socket/client/hspool_test.pl
+index 7fe073301b18..091cb4967cb8 100755
+--- a/plugin/handler_socket/client/hspool_test.pl
++++ b/plugin/handler_socket/client/hspool_test.pl
+@@ -31,8 +31,8 @@
+ my $mysql_user = 'root';
+ my $mysql_password = '';
+ 
+-my $dsn = "DBI:mysql:database=;host=$host;port=$mysqlport"
+-        . ";mysql_server_prepare=$ssps";
++my $dsn = "DBI:MariaDB:database=;host=$host;port=$mysqlport"
++        . ";mariadb_server_prepare=$ssps";
+ my $dbh = DBI->connect($dsn, $mysql_user, $mysql_password,
+ 	{ RaiseError => 1 });
+ my $hsargs = { 'host' => $host, 'port' => $hsport_rd };
+diff --git a/plugin/handler_socket/client/hstest.pl b/plugin/handler_socket/client/hstest.pl
+index 4d177b6cdc87..de39fcb6d6c5 100755
+--- a/plugin/handler_socket/client/hstest.pl
++++ b/plugin/handler_socket/client/hstest.pl
+@@ -33,8 +33,8 @@
+ my $keytype = get_conf("keytype", "varchar(32)");
+ my $file = get_conf("file", undef);
+ 
+-my $dsn = "DBI:mysql:database=;host=$host;port=$mysqlport"
+-	. ";mysql_server_prepare=$ssps";
++my $dsn = "DBI:MariaDB:database=;host=$host;port=$mysqlport"
++	. ";mariadb_server_prepare=$ssps";
+ my $dbh = DBI->connect($dsn, $mysqluser, $mysqlpass, { RaiseError => 1 });
+ my $hsargs = { 'host' => $host, 'port' => $hsport };
+ my $cli = new Net::HandlerSocket($hsargs);
+diff --git a/plugin/handler_socket/regtest/common/hstest.pm b/plugin/handler_socket/regtest/common/hstest.pm
+index 348242b027f3..89f273c9786b 100644
+--- a/plugin/handler_socket/regtest/common/hstest.pm
++++ b/plugin/handler_socket/regtest/common/hstest.pm
+@@ -29,10 +29,10 @@ sub get_dbi_connection {
+     = ($conf{dbname}, $conf{host}, $conf{myport}, $conf{ssps},
+       $conf{user}, $conf{pass});
+   my $mycnf = "binary_my.cnf";
+-  my $dsn = "DBI:mysql:database=;host=$host;port=$myport"
+-    . ";mysql_server_prepare=$ssps"
+-    . ";mysql_read_default_group=perl"
+-    . ";mysql_read_default_file=../common/$mycnf";
++  my $dsn = "DBI:MariaDB:database=;host=$host;port=$myport"
++    . ";mariadb_server_prepare=$ssps"
++    . ";mariadb_read_default_group=perl"
++    . ";mariadb_read_default_file=../common/$mycnf";
+   my $dbh = DBI->connect($dsn, $user, $pass, { RaiseError => 1 });
+   return $dbh;
+ }
+diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh
+index 2001efae3929..6b4d758a5131 100644
+--- a/scripts/mysql_convert_table_format.sh
++++ b/scripts/mysql_convert_table_format.sh
+@@ -57,10 +57,10 @@ if ($opt_port)
+ }
+ if (length($opt_socket))
+ {
+-  $connect_opt.=";mysql_socket=$opt_socket";
++  $connect_opt.=";mariadb_socket=$opt_socket";
+ }
+ 
+-$dbh = DBI->connect("DBI:mysql:$opt_database:${opt_host}$connect_opt",
++$dbh = DBI->connect("DBI:MariaDB:$opt_database:${opt_host}$connect_opt",
+ 		    $opt_user,
+ 		    $opt_password,
+ 		    { PrintError => 0})
+diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
+index c56cdea470c0..94e577a94a7f 100644
+#--- a/scripts/mysqlhotcopy.sh
+#+++ b/scripts/mysqlhotcopy.sh
+#@@ -192,12 +192,12 @@ $opt{allowold} = 1 if $opt{keepold};
+# my $dsn;
+# $dsn  = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost");
+# $dsn .= ";port=$opt{port}" if $opt{port};
+#-$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
+#+$dsn .= ";mariadb_socket=$opt{socket}" if $opt{socket};
+# 
+#-# use mysql_read_default_group=mysqlhotcopy so that [client] and
+#+# use mariadb_read_default_group=mysqlhotcopy so that [client] and
+# # [mysqlhotcopy] groups will be read from standard options files.
+# 
+#-my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy",
+#+my $dbh = DBI->connect("DBI:MariaDB:$dsn;mariadb_read_default_group=mysqlhotcopy",
+#                         $opt{user}, $opt{password},
+# {
+#     RaiseError => 1,
+@@ -796,7 +796,7 @@ sub record_log_pos {
+ 	
+ 	my $row_hash = get_row_hash( $dbh, "show slave status" );
+ 	my ($master_host, $log_file, $log_pos ); 
+-	if ( $dbh->{mysql_serverinfo} =~ /^3\.23/ ) {
++	if ( $dbh->{mariadb_serverinfo} =~ /^3\.23/ ) {
+ 	    ($master_host, $log_file, $log_pos ) 
+ 	      = @{$row_hash}{ qw / Master_Host Log_File Pos / };
+ 	} else {
+diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
+index 3991d16c6b18..6ef39c4d91f8 100644
+--- a/sql-bench/server-cfg.sh
++++ b/sql-bench/server-cfg.sh
+@@ -116,8 +116,8 @@ sub new
+   bless $self;
+ 
+   $self->{'cmp_name'}		= "mysql";
+-  $self->{'data_source'}	= "DBI:mysql:database=$database;host=$host";
+-  $self->{'data_source'} .= ";mysql_socket=$socket" if($socket);
++  $self->{'data_source'}	= "DBI:MariaDB:database=$database;host=$host";
++  $self->{'data_source'} .= ";mariadb_socket=$socket" if($socket);
+   $self->{'data_source'} .= ";$connect_options" if($connect_options);
+   $self->{'limits'}		= \%limits;
+   $self->{'blob'}		= "blob";
+diff --git a/storage/maria/ma_ft_test1.h b/storage/maria/ma_ft_test1.h
+index 0f4997a71424..df86eeceb66c 100644
+--- a/storage/maria/ma_ft_test1.h
++++ b/storage/maria/ma_ft_test1.h
+@@ -311,7 +311,7 @@ struct { const char *f0, *f2; } data[NDATAS] = {
+    {"18.4.49", "Problems linking with the C API"},
+    {"18.4.50", "How to make a thread-safe client"},
+    {"18.5", "MySQL Perl API's"},
+-   {"18.5.1", "DBI with DBD::mysql"},
++   {"18.5.1", "DBI with DBD::MariaDB"},
+    {"18.5.1.1", "The DBI interface"},
+    {"18.5.1.2", "More DBI/DBD information"},
+    {"18.6", "MySQL Java connectivity (JDBC)"},
+diff --git a/tests/big_record.pl b/tests/big_record.pl
+index cb1f89984682..b2aeee276586 100755
+--- a/tests/big_record.pl
++++ b/tests/big_record.pl
+@@ -37,9 +37,9 @@
+ print "Connection to database $test_db\n";
+ 
+ $extra_options="";
+-$extra_options.=":mysql_compression=1" if ($opt_compress);
++$extra_options.=":mariadb_compression=1" if ($opt_compress);
+ 
+-$dbh = DBI->connect("DBI:mysql:$opt_db:$host$extra_options",$opt_user,$opt_password) || die "Can't connect: $DBI::errstr\n";
++$dbh = DBI->connect("DBI:MariaDB:$opt_db:$host$extra_options",$opt_user,$opt_password) || die "Can't connect: $DBI::errstr\n";
+ 
+ $dbh->do("drop table if exists $opt_table");
+ 
+@@ -65,7 +65,7 @@
+ 
+ print "\nReading records\n";
+ 
+-$sth=$dbh->prepare("select * from $opt_table", { "mysql_use_result" => 1}) or die $dbh->errstr;
++$sth=$dbh->prepare("select * from $opt_table", { "mariadb_use_result" => 1}) or die $dbh->errstr;
+ 
+ $sth->execute() or die $sth->errstr;
+ 
+diff --git a/tests/check_async_queries.pl b/tests/check_async_queries.pl
+index b599bc334d3c..0039dd90eb9c 100644
+--- a/tests/check_async_queries.pl
++++ b/tests/check_async_queries.pl
+@@ -13,7 +13,7 @@
+ die "Usage: $0 <host> <user> <password> <database>\n"
+     unless @ARGV == 4;
+ 
+-my $dbh= DBI->connect("DBI:mysql:database=$ARGV[3];host=$ARGV[0]",
++my $dbh= DBI->connect("DBI:MariaDB:database=$ARGV[3];host=$ARGV[0]",
+                       $ARGV[1], $ARGV[2],
+                       { RaiseError => 1, PrintError => 0 });
+ 
+diff --git a/tests/consistent_snapshot.pl b/tests/consistent_snapshot.pl
+index 9e53eaea6a1a..5c006b0092d5 100755
+--- a/tests/consistent_snapshot.pl
++++ b/tests/consistent_snapshot.pl
+@@ -17,7 +17,7 @@
+ my $stop_time= time() + $DURATION;
+ 
+ sub my_connect {
+-  my $dbh= DBI->connect("dbi:mysql:mysql_socket=/tmp/mysql.sock;database=test",
++  my $dbh= DBI->connect("DBI:MariaDB:mariadb_socket=/tmp/mysql.sock;database=test",
+                         "root", undef, { RaiseError=>1, PrintError=>0, AutoCommit=>0});
+   $dbh->do("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ");
+   $dbh->do("SET SESSION autocommit = 0");
+diff --git a/tests/drop_test.pl b/tests/drop_test.pl
+index 329f65eb65da..15a75f4908c6 100755
+--- a/tests/drop_test.pl
++++ b/tests/drop_test.pl
+@@ -50,7 +50,7 @@ package main;
+ $start_time=new Benchmark;
+ if (!$opt_skip_create)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table if exists $firsttable, ${firsttable}_1, ${firsttable}_2");
+@@ -81,7 +81,7 @@ package main;
+ 
+ if (!$opt_skip_delete && !$errors)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table $firsttable");
+@@ -103,7 +103,7 @@ sub test_insert
+ {
+   my ($dbh,$i);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -124,7 +124,7 @@ sub test_drop
+   my ($id) = @_;
+   my ($dbh,$i,$sth,$error_counter,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $error_counter=0;
+@@ -169,7 +169,7 @@ sub test_select
+ {
+   my ($dbh,$i,$sth,@row,$error_counter,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -206,7 +206,7 @@ sub test_flush
+ {
+   my ($dbh,$i,$sth,@row,$error_counter,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/fork_big.pl b/tests/fork_big.pl
+index 623377ab5cdd..2f803b7fdd3c 100755
+--- a/tests/fork_big.pl
++++ b/tests/fork_big.pl
+@@ -65,7 +65,7 @@ package main;
+ ####
+ 
+ $start_time=new Benchmark;
+-$dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++$dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		    $opt_user, $opt_password,
+ 		  { PrintError => 0}) || die $DBI::errstr;
+ if (!$opt_skip_create)
+@@ -155,7 +155,7 @@ package main;
+ if (!$opt_skip_delete && !$errors)
+ {
+   my $table_def;
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -189,7 +189,7 @@ sub test_insert
+     $from_table=0; $to_table=$numtables-1;
+   }
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -218,7 +218,7 @@ sub test_select
+ {
+   my ($dbh, $i, $j, $count, $loop, $count_query, $row_counts);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -255,7 +255,7 @@ sub test_select_count
+ {
+   my ($dbh, $i, $j, $count, $loop);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -285,7 +285,7 @@ sub test_join
+ {
+   my ($dbh, $i, $j, $count, $loop, $count_query, $row_counts);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -326,7 +326,7 @@ sub test_delete
+ 
+   $table_count=2;
+   $count=0;
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -360,7 +360,7 @@ sub test_delete
+ sub test_update
+ {
+   my ($dbh, $i, $j, $row_counts, $count_query, $count, $loop);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -403,7 +403,7 @@ sub test_update
+ sub test_check
+ {
+   my ($dbh, $sth, $row, $i, $j, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -440,7 +440,7 @@ sub test_check
+ sub test_repair
+ {
+   my ($dbh, $sth, $row, $i, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -474,7 +474,7 @@ sub test_flush
+ {
+   my ($dbh,$count,$tables);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -502,7 +502,7 @@ sub test_database
+ {
+   my ($database) = @_;
+   my ($dbh, $sth, $row, $i, $type, $tables);
+-  $dbh = DBI->connect("DBI:mysql:$database:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$database:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -535,7 +535,7 @@ sub test_database
+ sub test_alter
+ {
+   my ($dbh, $sth, $row, $i, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -559,7 +559,7 @@ sub test_alter
+ sub signal_abort
+ {
+   my ($dbh);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl
+index c844d2908345..a2b465734dc5 100644
+--- a/tests/fork_big2.pl
++++ b/tests/fork_big2.pl
+@@ -81,7 +81,7 @@ package main;
+ }
+ 
+ $start_time=new Benchmark;
+-$dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++$dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		    $opt_user, $opt_password,
+ 		  { PrintError => 0}) || die $DBI::errstr;
+ if (!$opt_skip_create)
+@@ -212,7 +212,7 @@ package main;
+ if (!$opt_skip_drop && !$errors)
+ {
+   my $table_def;
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -257,7 +257,7 @@ sub test_insert
+     $from_table=0; $to_table=$numtables-1;
+   }
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -286,7 +286,7 @@ sub test_select
+ {
+   my ($dbh, $i, $j, $count, $loop);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -323,7 +323,7 @@ sub test_select_count
+ {
+   my ($dbh, $i, $j, $count, $loop);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -353,7 +353,7 @@ sub test_join
+ {
+   my ($dbh, $i, $j, $count, $loop);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -391,7 +391,7 @@ sub test_join_count
+ {
+   my ($dbh, $i, $j, $count, $loop);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -446,7 +446,7 @@ sub test_delete
+ 
+   $table_count=2;
+   $count=0;
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -480,7 +480,7 @@ sub test_delete
+ sub test_update
+ {
+   my ($dbh, $i, $j, $row_counts, $count_query, $count, $loop);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -523,7 +523,7 @@ sub test_update
+ sub test_check
+ {
+   my ($dbh, $row, $i, $j, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -560,7 +560,7 @@ sub test_check
+ sub test_repair
+ {
+   my ($dbh, $row, $i, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -594,7 +594,7 @@ sub test_flush
+ {
+   my ($dbh,$count,$tables);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -621,7 +621,7 @@ sub test_resize
+ {
+   my ($dbh, $key_buffer_size);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -648,7 +648,7 @@ sub test_database
+ {
+   my ($database) = @_;
+   my ($dbh, $row, $i, $type, $tables);
+-  $dbh = DBI->connect("DBI:mysql:$database:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$database:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -681,7 +681,7 @@ sub test_database
+ sub test_alter
+ {
+   my ($dbh, $row, $i, $type, $table);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -705,7 +705,7 @@ sub test_alter
+ sub signal_abort
+ {
+   my ($dbh);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/index_corrupt.pl b/tests/index_corrupt.pl
+index 6b04ce8a59c5..6f31b85bd614 100755
+--- a/tests/index_corrupt.pl
++++ b/tests/index_corrupt.pl
+@@ -51,7 +51,7 @@ package main;
+ $start_time=new Benchmark;
+ if (!$opt_skip_create)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table if exists $firsttable, $secondtable");
+@@ -111,7 +111,7 @@ package main;
+ 
+ if (!$opt_skip_delete && !$errors)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table $firsttable, $secondtable");
+@@ -134,7 +134,7 @@ sub insert_in_bench
+ {
+   my ($dbh,$rows,$found,$i);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   for ($rows= 1; $rows <= $opt_loop_count ; $rows++)
+@@ -179,7 +179,7 @@ sub select_from_bench
+ {
+   my ($dbh,$rows,$cursor);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   for ($rows= 1; $rows < $opt_loop_count ; $rows++)
+@@ -206,7 +206,7 @@ sub delete_from_bench
+ {
+   my ($dbh,$row, $t_value, $t2_value, $statement, $cursor);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/insert_and_repair.pl b/tests/insert_and_repair.pl
+index 18091c92718d..dfa490456cb8 100755
+--- a/tests/insert_and_repair.pl
++++ b/tests/insert_and_repair.pl
+@@ -49,7 +49,7 @@ package main;
+ $start_time=new Benchmark;
+ if (!$opt_skip_create)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table if exists $firsttable, $secondtable");
+@@ -79,7 +79,7 @@ package main;
+ 
+ if (!$opt_skip_delete && !$errors)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table $firsttable,$secondtable");
+@@ -100,7 +100,7 @@ sub insert_in_bench1
+ {
+   my ($dbh,$rows,$found,$i);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $rows=$found=0;
+@@ -123,7 +123,7 @@ sub insert_in_bench2
+ {
+   my ($dbh,$rows,$found,$i);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $rows=$found=0;
+@@ -149,7 +149,7 @@ sub repair_and_check
+       $table);
+   $found1=$found2=0; $last_found1=$last_found2= -1;
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/mail_to_db.pl b/tests/mail_to_db.pl
+index e50415d96f31..94f3955b2c32 100755
+--- a/tests/mail_to_db.pl
++++ b/tests/mail_to_db.pl
+@@ -110,12 +110,12 @@ sub main
+     die "FATAL: Can't find inbox file: $ARGV[$i]\n" if (! -f $ARGV[$i]);
+   }
+ 
+-  $connect_arg = "DBI:mysql:";
++  $connect_arg = "DBI:MariaDB:";
+   push @args, "database=$opt_db" if defined($opt_db);
+   push @args, "host=$opt_host" if defined($opt_host);
+   push @args, "port=$opt_port" if defined($opt_port);
+-  push @args, "mysql_socket=$opt_socket" if defined($opt_socket);
+-  push @args, "mysql_read_default_group=mail_to_db";
++  push @args, "mariadb_socket=$opt_socket" if defined($opt_socket);
++  push @args, "mariadb_read_default_group=mail_to_db";
+   $connect_arg .= join ';', @args;
+   $dbh = DBI->connect("$connect_arg", $opt_user, $opt_password,
+ 		     { PrintError => 0})
+diff --git a/tests/pmail.pl b/tests/pmail.pl
+index 359256c25b34..de469923c7d3 100755
+--- a/tests/pmail.pl
++++ b/tests/pmail.pl
+@@ -60,7 +60,7 @@
+ #### Connect and parsing the query to MySQL
+ ####
+ 
+-$dbh= DBI->connect("DBI:mysql:$opt_db:$opt_host:port=$opt_port:mysql_socket=$opt_socket", $opt_user,$opt_password, { PrintError => 0})
++$dbh= DBI->connect("DBI:MariaDB:$opt_db:$opt_host:port=$opt_port:mariadb_socket=$opt_socket", $opt_user,$opt_password, { PrintError => 0})
+ || die $DBI::errstr;
+ 
+ main();
+diff --git a/tests/rename_test.pl b/tests/rename_test.pl
+index d7097df1e4e3..ff1b73434e54 100755
+--- a/tests/rename_test.pl
++++ b/tests/rename_test.pl
+@@ -48,7 +48,7 @@ package main;
+ $start_time=new Benchmark;
+ if (!$opt_skip_create)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table if exists $firsttable, ${firsttable}_1, ${firsttable}_2");
+@@ -81,7 +81,7 @@ package main;
+ 
+ if (!$opt_skip_delete && !$errors)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $dbh->do("drop table $firsttable");
+@@ -103,7 +103,7 @@ sub test_insert
+ {
+   my ($dbh,$i,$error);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -128,7 +128,7 @@ sub test_rename
+   my ($id) = @_;
+   my ($dbh,$i,$error_counter,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+   $error_counter=0;
+@@ -158,7 +158,7 @@ sub test_select
+ {
+   my ($dbh,$i,$sth,@row,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -192,7 +192,7 @@ sub test_flush
+ {
+   my ($dbh,$i,$sth,@row,$error_counter,$sleep_time);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/test_delayed_insert.pl b/tests/test_delayed_insert.pl
+index cb5b86a228d1..2ebb42e08d1c 100755
+--- a/tests/test_delayed_insert.pl
++++ b/tests/test_delayed_insert.pl
+@@ -50,7 +50,7 @@ package main;
+ $start_time=new Benchmark;
+ if (!$opt_skip_create)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $Mysql::QUIET = 1;
+   $dbh->do("drop table if exists $firsttable,$secondtable");
+   $Mysql::QUIET = 0;
+@@ -87,7 +87,7 @@ package main;
+ 
+ if (!$opt_skip_delete && !$errors)
+ {
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $dbh->do("drop table $firsttable");
+   $dbh->do("drop table $secondtable");
+ }
+@@ -107,7 +107,7 @@ sub test_1
+ {
+   my ($dbh,$tmpvar,$rows,$found,$i);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=1;
+   $rows=$found=0;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -131,7 +131,7 @@ sub test_delayed_1
+ {
+   my ($dbh,$tmpvar,$rows,$found,$i,$id);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=1;
+   $rows=$found=0;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -162,7 +162,7 @@ sub test_delayed_2
+ {
+   my ($dbh,$tmpvar,$rows,$found,$i,$id);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=1;
+   $rows=$found=0;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -196,7 +196,7 @@ sub test_2
+ {
+   my ($dbh,$id,$tmpvar,$rows,$found,$i,$max_id,$tmp,$sth,$count);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=111111;
+   $rows=$found=$max_id=$id=0;
+   for ($i=0 ; $i < $opt_loop_count ; $i++)
+@@ -245,7 +245,7 @@ sub test_2
+ sub test_3
+ {
+   my ($dbh,$id,$tmpvar,$rows,$i,$count);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=222222;
+   $rows=0;
+   for ($i=0 ; $i < $opt_loop_count ; $i++)
+@@ -269,7 +269,7 @@ sub test_3
+ sub test_4
+ {
+   my ($dbh,$id,$tmpvar,$rows,$i,$count);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=333333;
+   $rows=0;
+   for ($i=0 ; $i < $opt_loop_count; $i++)
+@@ -288,7 +288,7 @@ sub test_4
+ sub test_5
+ {
+   my ($dbh,$id,$tmpvar,$rows,$i,$max_id,$count,$sth);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $tmpvar=444444;
+   $rows=$max_id=0;
+   for ($i=0 ; $i < $opt_loop_count ; $i++)
+@@ -328,7 +328,7 @@ sub test_5
+ sub test_del
+ {
+   my ($dbh,$min_id,$i,$sth,$rows);
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host") || die $DBI::errstr;
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host") || die $DBI::errstr;
+   $rows=0;
+   for ($i=0 ; $i < $opt_loop_count/3; $i++)
+   {
+@@ -357,7 +357,7 @@ sub test_flush
+   my ($dbh,$sth,$found1,$last_found1,$i,@row);
+   $found1=0; $last_found1=-1;
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+diff --git a/tests/truncate.pl b/tests/truncate.pl
+index 98791a15b2c6..85a7888bc4af 100755
+--- a/tests/truncate.pl
++++ b/tests/truncate.pl
+@@ -47,7 +47,7 @@ package main;
+ ####
+ 
+ $start_time=new Benchmark;
+-$dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++$dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		    $opt_user, $opt_password,
+ 		  { PrintError => 0}) || die $DBI::errstr;
+ if (!$opt_skip_create)
+@@ -100,7 +100,7 @@ package main;
+ if (!$opt_skip_delete && !$errors)
+ {
+   my $table_def;
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
+@@ -127,7 +127,7 @@ sub test_truncate
+ {
+   my ($dbh,$i,$j,$count,$table_def,$table);
+ 
+-  $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
++  $dbh = DBI->connect("DBI:MariaDB:$opt_db:$opt_host",
+ 		      $opt_user, $opt_password,
+ 		    { PrintError => 0}) || die $DBI::errstr;
+ 
diff --git a/SPECS/mariadb.spec b/SPECS/mariadb.spec
index dc72386..4b21bce 100644
--- a/SPECS/mariadb.spec
+++ b/SPECS/mariadb.spec
@@ -1,3 +1,10 @@
+# To both save infrastrucutre resources and workaround for i686 FTBFS
+ExcludeArch: %{ix86}
+
+#   This is a fix for the https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
+#   So the beaviour will be the same also in F31 nad F32
+%undefine __cmake_in_source_build
+
 # Prefix that is used for patches
 %global pkg_name %{name}
 %global pkgnamepatch mariadb
@@ -6,7 +13,17 @@
 %{!?runselftest:%global runselftest 1}
 
 # Set this to 1 to see which tests fail, but 0 on production ready build
-%{!?ignore_testsuite_result:%global ignore_testsuite_result 0}
+%global ignore_testsuite_result 0
+
+# The last version on which the full testsuite has been run
+# In case of further rebuilds of that version, don't require full testsuite to be run
+# run only "main" suite
+%global last_tested_version 10.11.10
+# Set to 1 to force run the testsuite even if it was already tested in current version
+%global force_run_testsuite 0
+
+# Aditional SELinux rules
+%global require_mysql_selinux 1
 
 # In f20+ use unversioned docdirs, otherwise the old versioned one
 %global _pkgdocdirname %{pkg_name}%{!?_pkgdocdir:-%{version}}
@@ -18,37 +35,31 @@
 
 
 
-# TokuDB engine
-#   https://mariadb.com/kb/en/mariadb/tokudb/
-#   TokuDB engine is available only for x86_64
 # Mroonga engine
 #   https://mariadb.com/kb/en/mariadb/about-mroonga/
 #   Current version in MariaDB, 7.07, only supports the x86_64
 #   Mroonga upstream warns about using 32-bit package: http://mroonga.org/docs/install.html
 # RocksDB engine
-#   https://mariadb.com/kb/en/library/myrocks-supported-platforms/
-#   RocksB engine is available only for x86_64
+#   https://mariadb.com/kb/en/library/about-myrocks-for-mariadb/
+#   RocksDB engine is available only for x86_64
 #   RocksDB may be built with jemalloc, if specified in CMake
-# Cassandra engine
-#   Experimental version of the Cassandra storage engine
-#   The tests needs running cassandra server
-#   Do not build it for now
-%if "%_arch" == "x86_64" && 0%{?fedora}
-%bcond_without tokudb
+%ifarch x86_64
+%if 0%{?fedora}
 %bcond_without mroonga
 %bcond_without rocksdb
-%bcond_with cassandra
 %else
-%bcond_with tokudb
 %bcond_with mroonga
 %bcond_with rocksdb
-%bcond_with cassandra
+%endif
 %endif
 
 # The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing
 # hierarchies and more complex graph structures to be handled in a relational fashion
 %bcond_without oqgraph
 
+# PAM authentication plugin
+%bcond_without pam
+
 # Other plugins
 %if 0%{?fedora}
 %bcond_without cracklib
@@ -59,6 +70,7 @@
 %bcond_with connect
 %bcond_with sphinx
 %endif
+
 %bcond_without gssapi
 
 # For some use cases we do not need some parts of the package. Set to "...with" to exclude
@@ -75,16 +87,11 @@
 %bcond_without test
 %bcond_without galera
 %bcond_without backup
-%if 0%{?fedora}
-%bcond_without bench
-%else
-%bcond_with bench
-%endif
 
 # When there is already another package that ships /etc/my.cnf,
 # rather include it than ship the file again, since conflicts between
 # those files may create issues
-%if 0%{?fedora} >= 29 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} > 7
 %bcond_with config
 %else
 %bcond_without config
@@ -94,24 +101,36 @@
 %bcond_with    debug
 
 # Page compression algorithms for InnoDB & XtraDB
-# lz4 currently cannot be turned off by CMake, only by not having lz4-devel package in the buildroot
-#   https://jira.mariadb.org/browse/MDEV-15932
 %bcond_without lz4
 
 
 
-# MariaDB 10.0 and later requires pcre >= 8.35, otherwise we need to use
+# MariaDB 10.0 and later requires pcre >= 10.34, otherwise we need to use
 # the bundled library, since the package cannot be build with older version
-%if 0%{?fedora} || 0%{?rhel} > 7
+#   https://mariadb.com/kb/en/pcre/
+%if 0%{?fedora} || 0%{?rhel} > 8
 %bcond_without unbundled_pcre
 %else
 %bcond_with unbundled_pcre
-%global pcre_bundled_version 8.45
+%global pcre_bundled_version 10.44
+%endif
+
+# To avoid issues with a breaking change in FMT library, bundle it on systems where FMT wasn't fixed yet
+# See mariadb-libfmt.patch for detailed description.
+%bcond_without bundled_fmt
+%if %{with bundled_fmt}
+%global fmt_bundled_version 11.0.2
+%endif
+
+# Use main python interpretter version
+%if 0%{?fedora} || 0%{?rhel} > 7
+%global python_path /usr/bin/python3
+%else
+%global python_path /usr/bin/python2
 %endif
 
 # Include systemd files
 %global daemon_name %{name}
-%global daemondir %{_unitdir}
 %global daemon_no_prefix %{pkg_name}
 %global mysqld_pid_dir mariadb
 
@@ -127,8 +146,6 @@
 # Home directory of mysql user should be same for all packages that create it
 %global mysqluserhome /var/lib/mysql
 
-
-
 # Provide mysql names for compatibility
 %if 0%{?fedora}
 %bcond_without mysql_names
@@ -136,22 +153,23 @@
 %bcond_with    mysql_names
 %endif
 
-
-
 # Make long macros shorter
 %global sameevr   %{epoch}:%{version}-%{release}
 
 Name:             mariadb
-Version:          10.3.39
+Version:          10.11.10
 Release:          1%{?with_debug:.debug}%{?dist}
 Epoch:            3
 
 Summary:          A very fast and robust SQL database server
 URL:              http://mariadb.org
-# Exceptions allow client libraries to be linked with most open source SW, not only GPL code. See README.mysql-license
+# Exceptions allow client libraries to be linked with most open source SW, not only GPL code.  See README.mysql-license
 License:          GPLv2 with exceptions and LGPLv2 and BSD
 
 Source0:          https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz
+%if %{with bundled_fmt}
+Source1:          https://github.com/fmtlib/fmt/releases/download/%{fmt_bundled_version}/fmt-%{fmt_bundled_version}.zip
+%endif
 Source2:          mysql_config_multilib.sh
 Source3:          my.cnf.in
 Source6:          README.mysql-docs
@@ -168,13 +186,29 @@ Source50:         rh-skipped-tests-base.list
 Source51:         rh-skipped-tests-arm.list
 Source52:         rh-skipped-tests-s390.list
 Source53:         rh-skipped-tests-ppc.list
-# Proposed upstream: https://jira.mariadb.org/browse/MDEV-12442
-# General upstream response was slightly positive
+# Red Hat OpenStack scripts:
+#   Clustercheck:
+#     Maintainer:
+#       Damien Ciabrini <dciabrin@redhat.com>
+#     Source / Upstream:
+#       Damien; based on https://github.com/olafz/percona-clustercheck
+#       not updated in 5 years; low-effort maintenance
+#     Purpose:
+#       In Openstack, galera is accessed like an A/P database, we have a
+#       load balancer (haproxy) that drives traffic to a single node and
+#       performs failover when the galera node monitor fails.
+#       clustercheck.sh is the monitoring script that is being called remotely
+#       by haproxy. It is a glue between haproxy and the local galera node that
+#       can run SQL commands to check whether the local galera is connected to the galera cluster.
+#     Proposed to MariaDB upstream: https://jira.mariadb.org/browse/MDEV-12442
+#       General upstream response was slightly positive
 Source70:         clustercheck.sh
 Source71:         LICENSE.clustercheck
+
 # Upstream said: "Generally MariaDB has more allows to allow for xtradb sst mechanism".
 # https://jira.mariadb.org/browse/MDEV-12646
 Source72:         mariadb-server-galera.te
+
 # Script to support encrypted rsync transfers when SST is required between nodes.
 # https://github.com/dciabrin/wsrep_sst_rsync_tunnel/blob/master/wsrep_sst_rsync_tunnel
 Source73:         wsrep_sst_rsync_tunnel
@@ -186,14 +220,17 @@ Patch4:           %{pkgnamepatch}-logrotate.patch
 Patch7:           %{pkgnamepatch}-scripts.patch
 #   Patch9: pre-configure to comply with guidelines
 Patch9:           %{pkgnamepatch}-ownsetup.patch
-#   Patch10: Add RHEL8 required security
-Patch10:          %{pkgnamepatch}-annocheck.patch
-#   Patch12: Downstream fix for a correct pkgconfig file location
-Patch12:          %{pkgnamepatch}-pcdir.patch
-#   Patch13: Fix failing 10.3.39 ssl and disks tests
-Patch13:          %{pkgnamepatch}-10.3.39-tests.patch
-#   Patch14: Backport MDEV-30402 socat patch
-Patch14:          %{pkgnamepatch}-mdev-30402.patch
+#   Patch10: Fix cipher name in the SSL Cipher name test
+Patch10:          %{pkgnamepatch}-ssl-cipher-tests.patch
+#   Patch16: Workaround for "chown 0" with priviledges dropped to "mysql" user
+Patch16:          %{pkgnamepatch}-auth_pam_tool_dir.patch
+#   Patch17: Revert of an upstream commit
+Patch17:          upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch
+
+#   Patch13: bundle the FMT library
+Patch13:          %{pkgnamepatch}-libfmt.patch
+#   Patch14: make MTR port calculation reasonably predictable
+Patch14:          %{pkgnamepatch}-mtr.patch
 
 BuildRequires:    cmake gcc-c++
 BuildRequires:    multilib-rpm-config
@@ -213,13 +250,16 @@ BuildRequires:    ncurses-devel
 # debugging stuff
 BuildRequires:    systemtap-sdt-devel
 # Bison SQL parser; needed also for wsrep API
-BuildRequires:    bison bison-devel
+BuildRequires:    bison >= 2.4
+BuildRequires:    bison-devel >= 2.4
+
+%{?with_debug:BuildRequires:    valgrind-devel}
 
 # auth_pam.so plugin will be build if pam-devel is installed
 BuildRequires:    pam-devel
-# use either new enough version of pcre or provide bundles(pcre)
-%{?with_unbundled_pcre:BuildRequires: pcre-devel >= 8.35 pkgconf}
-%{!?with_unbundled_pcre:Provides: bundled(pcre) = %{pcre_bundled_version}}
+# use either new enough version of pcre2 or provide bundles(pcre2)
+%{?with_unbundled_pcre:BuildRequires: pcre2-devel >= 10.34 pkgconf}
+%{!?with_unbundled_pcre:Provides: bundled(pcre2) = %{pcre_bundled_version}}
 # Few utilities needs Perl
 %if 0%{?fedora} || 0%{?rhel} > 7
 BuildRequires:    perl-interpreter
@@ -230,22 +270,48 @@ BuildRequires:    python3
 # Tests requires time and ps and some perl modules
 BuildRequires:    procps
 BuildRequires:    time
+BuildRequires:    perl(base)
+BuildRequires:    perl(Cwd)
+BuildRequires:    perl(Data::Dumper)
+BuildRequires:    perl(English)
 BuildRequires:    perl(Env)
+BuildRequires:    perl(Errno)
 BuildRequires:    perl(Exporter)
 BuildRequires:    perl(Fcntl)
+BuildRequires:    perl(File::Basename)
+BuildRequires:    perl(File::Copy)
+BuildRequires:    perl(File::Find)
+BuildRequires:    perl(File::Spec)
+BuildRequires:    perl(File::Spec::Functions)
 BuildRequires:    perl(File::Temp)
-BuildRequires:    perl(Data::Dumper)
 BuildRequires:    perl(Getopt::Long)
+BuildRequires:    perl(IO::File)
+BuildRequires:    perl(IO::Handle)
+BuildRequires:    perl(IO::Select)
+BuildRequires:    perl(IO::Socket)
+BuildRequires:    perl(IO::Socket::INET)
 BuildRequires:    perl(IPC::Open3)
+BuildRequires:    perl(lib)
 BuildRequires:    perl(Memoize)
+BuildRequires:    perl(POSIX)
 BuildRequires:    perl(Socket)
+BuildRequires:    perl(strict)
+BuildRequires:    perl(Symbol)
 BuildRequires:    perl(Sys::Hostname)
+BuildRequires:    perl(Term::ANSIColor)
 BuildRequires:    perl(Test::More)
 BuildRequires:    perl(Time::HiRes)
-BuildRequires:    perl(Symbol)
+BuildRequires:    perl(Time::localtime)
+BuildRequires:    perl(warnings)
 # for running some openssl tests rhbz#1189180
 BuildRequires:    openssl openssl-devel
 
+#BuildRequires:    fmt-devel
+
+%if %{with debug}
+BuildRequires:    valgrind-devel
+%endif
+
 Requires:         bash coreutils grep
 
 Requires:         %{name}-common%{?_isa} = %{sameevr}
@@ -255,7 +321,7 @@ Requires:         %{name}-common%{?_isa} = %{sameevr}
 Requires:         %{name}-libs%{?_isa} = %{sameevr}
 %else
 # If not built with client library in this package, use connector-c
-Requires:         mariadb-connector-c >= 3.1.11
+Requires:         mariadb-connector-c >= 3.0
 %endif
 
 %if %{with mysql_names}
@@ -269,11 +335,8 @@ Suggests:         %{name}-server%{?_isa} = %{sameevr}
 
 Conflicts:        mysql
 
-# obsoletion of mariadb-galera
-Provides: mariadb-galera = %{sameevr}
-
-# Filtering: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
-%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::)
+# Filtering: https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/
+%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::|wsrep)
 %global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/%{pkg_name}/plugin/.*\\.so)$
 
 # Define license macro if not present
@@ -294,14 +357,14 @@ Requires:         %{name}-common%{?_isa} = %{sameevr}
 %if %{with mysql_names}
 Provides:         mysql-libs = %{sameevr}
 Provides:         mysql-libs%{?_isa} = %{sameevr}
-%endif # mysql_names
+%endif
 
 %description      libs
 The mariadb-libs package provides the essential shared libraries for any
 MariaDB/MySQL client program or interface. You will need to install this
 package to use any other MariaDB package or any clients that need to connect
 to a MariaDB/MySQL server.
-%endif #clibrary
+%endif
 
 
 # At least main config file /etc/my.cnf is shared for client and server part
@@ -330,8 +393,6 @@ package itself.
 Summary:          The shared files required by server and client
 Requires:         %{_sysconfdir}/my.cnf
 
-# obsoletion of mariadb-galera-common
-Provides: mariadb-galera-common = %{sameevr}
 
 %if %{without clibrary}
 Obsoletes: %{name}-libs <= %{sameevr}
@@ -360,21 +421,14 @@ MariaDB packages.
 Summary:          The configuration files and scripts for galera replication
 Requires:         %{name}-common%{?_isa} = %{sameevr}
 Requires:         %{name}-server%{?_isa} = %{sameevr}
-Requires:         galera >= 25.3.3
+Requires:         galera >= 26.4.3
 Requires(post):   libselinux-utils
-%if 0%{?rhel} > 7
 Requires(post):   policycoreutils-python-utils
-%else
-Requires(post):   policycoreutils-python
-%endif
 # wsrep requirements
 Requires:         lsof
 # Default wsrep_sst_method
 Requires:         rsync
 
-# obsoletion of mariadb-galera-server
-Provides: mariadb-galera-server = %{sameevr}
-
 %description      server-galera
 MariaDB is a multi-user, multi-threaded SQL database server. It is a
 client/server implementation consisting of a server daemon (mysqld)
@@ -399,10 +453,15 @@ Requires:         %{name}-common%{?_isa} = %{sameevr}
 Requires:         %{name}-errmsg%{?_isa} = %{sameevr}
 Recommends:       %{name}-server-utils%{?_isa} = %{sameevr}
 Recommends:       %{name}-backup%{?_isa} = %{sameevr}
-%{?with_cracklib:Recommends:       %{name}-cracklib-password-check%{?_isa} = %{sameevr}}
-%{?with_gssapi:Recommends:       %{name}-gssapi-server%{?_isa} = %{sameevr}}
-%{?with_rocksdb:Recommends:       %{name}-rocksdb-engine%{?_isa} = %{sameevr}}
-%{?with_tokudb:Recommends:       %{name}-tokudb-engine%{?_isa} = %{sameevr}}
+%{?with_cracklib:Recommends:   %{name}-cracklib-password-check%{?_isa} = %{sameevr}}
+%{?with_gssapi:Recommends:     %{name}-gssapi-server%{?_isa} = %{sameevr}}
+%{?with_rocksdb:Suggests:      %{name}-rocksdb-engine%{?_isa} = %{sameevr}}
+%{?with_sphinx:Suggests:       %{name}-sphinx-engine%{?_isa} = %{sameevr}}
+%{?with_oqgraph:Suggests:      %{name}-oqgraph-engine%{?_isa} = %{sameevr}}
+%{?with_connect:Suggests:      %{name}-connect-engine%{?_isa} = %{sameevr}}
+%{?with_pam:Suggests:          %{name}-pam%{?_isa} = %{sameevr}}
+
+%{?with_bundled_fmt:Provides: bundled(fmt) = %{fmt_bundled_version}}
 
 Suggests:         mytop
 Suggests:         logrotate
@@ -410,6 +469,12 @@ Suggests:         logrotate
 Requires:         %{_sysconfdir}/my.cnf
 Requires:         %{_sysconfdir}/my.cnf.d
 
+# Aditional SELinux rules (common for MariaDB & MySQL) shipped in a separate package
+# For cases, where we want to fix a SELinux issues in MariaDB sooner than patched selinux-policy-targeted package is released
+%if %require_mysql_selinux
+Requires:         (mysql-selinux >= 1.0.10 if selinux-policy-targeted)
+%endif
+
 # for fuser in mysql-check-socket
 Requires:         psmisc
 
@@ -429,6 +494,13 @@ Provides:         mysql-compat-server%{?_isa} = %{sameevr}
 %endif
 Conflicts:        mysql-server
 
+# Bench subpackage has been deprecated in F32
+Obsoletes: %{name}-bench <= %{sameevr}
+
+%if %{without tokudb}
+Obsoletes:      %{name}-tokudb-engine <= %{sameevr}
+%endif
+
 %description      server
 MariaDB is a multi-user, multi-threaded SQL database server. It is a
 client/server implementation consisting of a server daemon (mysqld)
@@ -442,7 +514,8 @@ MariaDB is a community developed branch of MySQL.
 Summary:          The Open Query GRAPH engine for MariaDB
 Requires:         %{name}-server%{?_isa} = %{sameevr}
 # boost and Judy required for oograph
-BuildRequires:    boost-devel Judy-devel
+BuildRequires:    boost-devel >= 1.40.0
+BuildRequires:    Judy-devel
 
 %description      oqgraph-engine
 The package provides Open Query GRAPH engine (OQGRAPH) as plugin for MariaDB
@@ -494,18 +567,6 @@ The RocksDB storage engine is used for high performance servers on SSD drives.
 %endif
 
 
-%if %{with tokudb}
-%package          tokudb-engine
-Summary:          The TokuDB storage engine for MariaDB
-Requires:         %{name}-server%{?_isa} = %{sameevr}
-BuildRequires:    jemalloc-devel
-Requires:         jemalloc
-
-%description      tokudb-engine
-The TokuDB storage engine from Percona.
-%endif
-
-
 %if %{with cracklib}
 %package          cracklib-password-check
 Summary:          The password strength checking plugin
@@ -534,6 +595,21 @@ This plugin includes support for Kerberos on Unix.
 %endif
 
 
+%if %{with pam}
+%package          pam
+Summary:          PAM authentication plugin for the MariaDB server
+
+Requires:         %{name}-server%{?_isa} = %{sameevr}
+# This subpackage NEED the 'mysql' user/group (created during mariadb-server %pre) to be available prior installation
+Requires(pre):    %{name}-server%{?_isa} = %{sameevr}
+
+BuildRequires:    pam-devel
+
+%description      pam
+PAM authentication server-side plugin for MariaDB.
+%endif
+
+
 %if %{with sphinx}
 %package          sphinx-engine
 Summary:          The Sphinx storage engine for MariaDB
@@ -545,16 +621,6 @@ Requires:         sphinx libsphinxclient
 The Sphinx storage engine for MariaDB.
 %endif
 
-%if %{with cassandra}
-%package          cassandra-engine
-Summary:          The Cassandra storage engine for MariaDB - EXPERIMENTAL VERSION
-Requires:         %{name}-server%{?_isa} = %{sameevr}
-BuildRequires:    cassandra thrift-devel
-
-%description      cassandra-engine
-The Cassandra storage engine for MariaDB. EXPERIMENTAL VERSION!
-%endif
-
 
 %package          server-utils
 Summary:          Non-essential server utilities for MariaDB/MySQL applications
@@ -578,7 +644,7 @@ Summary:          Files for development of MariaDB/MySQL applications
 %{?with_clibrary:Requires:         %{name}-libs%{?_isa} = %{sameevr}}
 Requires:         openssl-devel
 %if %{without clibrary}
-Requires:         mariadb-connector-c-devel >= 3.1.11
+Requires:         mariadb-connector-c-devel >= 3.0
 %endif
 %if %{with mysql_names}
 Provides:         mysql-devel = %{sameevr}
@@ -637,30 +703,13 @@ the embedded version of the MariaDB server.
 %endif
 
 
-%if %{with bench}
-%package          bench
-Summary:          MariaDB benchmark scripts and data
-Requires:         %{name}%{?_isa} = %{sameevr}
-%if %{with mysql_names}
-Provides:         mysql-bench = %{sameevr}
-Provides:         mysql-bench%{?_isa} = %{sameevr}
-%endif
-Conflicts:        mysql-bench
-
-%description      bench
-MariaDB is a multi-user, multi-threaded SQL database server.
-MariaDB is a community developed branch of MySQL.
-This package contains benchmark scripts and data for use when benchmarking
-MariaDB.
-%endif
-
-
 %if %{with test}
 %package          test
 Summary:          The test suite distributed with MariaDB
 Requires:         %{name}%{?_isa} = %{sameevr}
 Requires:         %{name}-common%{?_isa} = %{sameevr}
 Requires:         %{name}-server%{?_isa} = %{sameevr}
+Requires:         patch
 Requires:         perl(Env)
 Requires:         perl(Exporter)
 Requires:         perl(Fcntl)
@@ -672,7 +721,6 @@ Requires:         perl(Socket)
 Requires:         perl(Sys::Hostname)
 Requires:         perl(Test::More)
 Requires:         perl(Time::HiRes)
-
 Conflicts:        mysql-test
 %if %{with mysql_names}
 Provides:         mysql-test = %{sameevr}
@@ -688,21 +736,46 @@ sources.
 
 
 %prep
-%setup -q -n mariadb-%{version}
+%setup -q -n %{pkg_name}-%{version}
+
+# Remove bundled code that is unused (all cases in which we use the system version of the library instead)
+# as required by https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling
+rm -r zlib libmariadb/external/zlib
+rm -r win libmariadb/win
+rm -r extra/wolfssl
+rm -r storage/columnstore
+rm -r debian
+
+%if %{with bundled_fmt}
+echo %{_vpath_builddir}
+mkdir -p  %{_vpath_builddir}/extra/libfmt/
+cp %{SOURCE1}  %{_vpath_builddir}/extra/libfmt/
+%endif
 
 # Remove JAR files that upstream puts into tarball
 find . -name "*.jar" -type f -exec rm --verbose -f {} \;
+# Remove testsuite for the mariadb-connector-c
+rm -rf libmariadb/unittest
+%if %{without rocksdb}
+rm -r storage/rocksdb/
+%endif
+
 
 %patch4 -p1
 %patch7 -p1
 %patch9 -p1
-%patch10 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-
-# workaround for upstream bug #56342
-#rm mysql-test/t/ssl_8k_key-master.opt
+%if %{with bundled_fmt}
+%patch -P13 -p1
+%endif
+%patch -P14 -p1
+# The test in Patch 10 has been recently updated by upstream
+# and the test was disabled in the testuite run
+#   main.ssl_cipher     [ disabled ]  MDEV-17184 - Failures with OpenSSL 1.1.1
+# Keeping the patch commented out, need to revisit
+#  once the test is re-enabled by upstream  in some future release
+#%%patch10 -p1
+%patch16 -p1
+%patch17 -R -p1
 
 # generate a list of tests that fail, but are not disabled by upstream
 cat %{SOURCE50} | tee -a mysql-test/unstable-tests
@@ -720,6 +793,9 @@ cat %{SOURCE52} | tee -a mysql-test/unstable-tests
 cat %{SOURCE53} | tee -a mysql-test/unstable-tests
 %endif
 
+mkdir -p %{_vpath_builddir}/bundles
+cp %{SOURCE1} %{_vpath_builddir}/bundles/
+
 cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} \
    %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE18} %{SOURCE70} %{SOURCE73} scripts
 
@@ -731,37 +807,26 @@ sed 's/mariadb-server-galera/%{name}-server-galera/' %{SOURCE72} > selinux/%{nam
 
 
 # Get version of PCRE, that upstream use
-pcre_maj=`grep '^m4_define(pcre_major' pcre/configure.ac | sed -r 's/^m4_define\(pcre_major, \[([0-9]+)\]\)/\1/'`
-pcre_min=`grep '^m4_define(pcre_minor' pcre/configure.ac | sed -r 's/^m4_define\(pcre_minor, \[([0-9]+)\]\)/\1/'`
+pcre_version=`grep -e "https://github.com/PCRE2Project/pcre2/releases/download" cmake/pcre.cmake | sed -r "s;.*pcre2-([[:digit:]]+\.[[:digit:]]+).*;\1;" `
 
-%if %{without unbundled_pcre}
 # Check if the PCRE version in macro 'pcre_bundled_version', used in Provides: bundled(...), is the same version as upstream actually bundles
-if [ %{pcre_bundled_version} != "$pcre_maj.$pcre_min" ]
-then
-  echo "\n Error: Bundled PCRE version is not correct. \n\tBundled version number:%{pcre_bundled_version} \n\tUpstream version number: $pcre_maj.$pcre_min\n"
+%if %{without unbundled_pcre}
+if [ %{pcre_bundled_version} != "$pcre_version" ] ; then
+  echo -e "\n Error: Bundled PCRE version is not correct. \n\tBundled version number: %{pcre_bundled_version} \n\tUpstream version number: $pcre_version\n"
   exit 1
 fi
 %else
 # Check if the PCRE version that upstream use, is the same as the one present in system
-pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre.pc --modversion 2>/dev/null `
-if [ "$pcre_system_version" != "$pcre_maj.$pcre_min" ]
-then
-  echo "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number:$pcre_system_version \n\tUpstream version number: $pcre_maj.$pcre_min\n"
+pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre2-*.pc --modversion 2>/dev/null | head -n 1`
+
+if [ "$pcre_system_version" != "$pcre_version" ] ; then
+  echo -e "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number: $pcre_system_version \n\tUpstream version number: $pcre_version\n"
 fi
-%endif # PCRE
-
-
-%if %{without rocksdb}
-rm -r storage/rocksdb/
 %endif
 
-# Remove python scripts remains from tokudb upstream (those files are not used anyway)
-rm -r storage/tokudb/mysql-test/tokudb/t/*.py
-
 
 
 %build
-%{set_build_flags}
 
 # fail quickly and obviously if user tries to build as root
 %if %runselftest
@@ -773,14 +838,6 @@ rm -r storage/tokudb/mysql-test/tokudb/t/*.py
     fi
 %endif
 
-CFLAGS="$CFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
-# Override all optimization flags when making a debug build
-%{?with_debug: CFLAGS="$CFLAGS -O0 -g"}
-
-CXXFLAGS="$CFLAGS"
-CPPFLAGS="$CFLAGS"
-export CFLAGS CXXFLAGS CPPFLAGS
-
 # The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX
 # so we can't use %%{_datadir} and so forth here.
 %cmake . \
@@ -807,9 +864,7 @@ export CFLAGS CXXFLAGS CPPFLAGS
          -DINSTALL_PLUGINDIR="%{_lib}/%{pkg_name}/plugin" \
          -DINSTALL_SBINDIR=libexec \
          -DINSTALL_SCRIPTDIR=bin \
-         -DINSTALL_SQLBENCHDIR=share \
          -DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \
-         -DINSTALL_PCDIR=%{_lib}/pkgconfig \
          -DMYSQL_DATADIR="%{dbdatadir}" \
          -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
          -DTMPDIR=/var/tmp \
@@ -817,7 +872,7 @@ export CFLAGS CXXFLAGS CPPFLAGS
          -DGROONGA_NORMALIZER_MYSQL_PROJECT_NAME=%{name}-server/groonga-normalizer-mysql \
          -DENABLED_LOCAL_INFILE=ON \
          -DENABLE_DTRACE=ON \
-         -DSECURITY_HARDENED=ON \
+         -DSECURITY_HARDENED=OFF \
          -DWITH_WSREP=%{?with_galera:ON}%{!?with_galera:OFF} \
          -DWITH_INNODB_DISALLOW_WRITES=%{?with_galera:ON}%{!?with_galera:OFF} \
          -DWITH_EMBEDDED_SERVER=%{?with_embedded:ON}%{!?with_embedded:OFF} \
@@ -826,7 +881,7 @@ export CFLAGS CXXFLAGS CPPFLAGS
          -DCONC_WITH_SSL=%{?with_clibrary:ON}%{!?with_clibrary:NO} \
          -DWITH_SSL=system \
          -DWITH_ZLIB=system \
-         -DWITH_JEMALLOC=%{?with_tokudb:yes}%{!?with_tokudb:no} \
+         -DWITH_LIBFMT=bundled \
          -DLZ4_LIBS=%{_libdir}/liblz4.so \
          -DLZ4_LIBS=%{?with_lz4:%{_libdir}/liblz4.so}%{!?with_lz4:} \
          -DWITH_INNODB_LZ4=%{?with_lz4:ON}%{!?with_lz4:OFF} \
@@ -836,22 +891,51 @@ export CFLAGS CXXFLAGS CPPFLAGS
          -DPLUGIN_CRACKLIB_PASSWORD_CHECK=%{?with_cracklib:DYNAMIC}%{!?with_cracklib:NO} \
          -DPLUGIN_ROCKSDB=%{?with_rocksdb:DYNAMIC}%{!?with_rocksdb:NO} \
          -DPLUGIN_SPHINX=%{?with_sphinx:DYNAMIC}%{!?with_sphinx:NO} \
-         -DPLUGIN_TOKUDB=%{?with_tokudb:DYNAMIC}%{!?with_tokudb:NO} \
          -DPLUGIN_CONNECT=%{?with_connect:DYNAMIC}%{!?with_connect:NO} \
+         -DPLUGIN_COLUMNSTORE=NO \
          -DPLUGIN_CLIENT_ED25519=OFF \
-         -DWITH_CASSANDRA=%{?with_cassandra:TRUE}%{!?with_cassandra:FALSE} \
+         -DPYTHON_SHEBANG=%{python_path} \
          -DPLUGIN_CACHING_SHA2_PASSWORD=%{?with_clibrary:DYNAMIC}%{!?with_clibrary:OFF} \
          -DPLUGIN_AWS_KEY_MANAGEMENT=NO \
          -DCONNECT_WITH_MONGO=OFF \
          -DCONNECT_WITH_JDBC=OFF \
+         -DPLUGIN_PROVIDER_LZMA=NO \
+         -DPLUGIN_HASHICORP_KEY_MANAGEMENT=NO \
 %{?with_debug: -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN=OFF -DWITH_INNODB_EXTRA_DEBUG=ON -DWITH_VALGRIND=ON}
 
-# Print all Cmake options values
-# cmake -LAH for List Advanced Help
-cmake -LA
+# The -DSECURITY_HARDENED is used to force a set of compilation flags for hardening
+# The issue is that the MariaDB upstream level of hardening is lower than expected by Red Hat
+# We disable this option to the default compilation flags (which have higher level of hardening) will be used
 
-%make_build VERBOSE=1
 
+CFLAGS="$CFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+# force PIC mode so that we can build libmysqld.so
+CFLAGS="$CFLAGS -fPIC"
+
+%if %{with debug}
+# Override all optimization flags when making a debug build
+# -D_FORTIFY_SOURCE requires optimizations enabled. Disable the fortify.
+%undefine _fortify_level
+CFLAGS=`echo "$CFLAGS" | sed -r 's/-O[0123]//'`
+
+CFLAGS="$CFLAGS -O0 -g"
+
+# Fixes for Fedora 32 & Rawhide (GCC 10.0):
+%if 0%{?fedora} >= 32
+CFLAGS="$CFLAGS -Wno-error=class-memaccess"
+CFLAGS="$CFLAGS -Wno-error=enum-conversion"
+%endif # f32
+%endif # debug
+
+CXXFLAGS="$CFLAGS"
+CPPFLAGS="$CFLAGS"
+export CFLAGS CXXFLAGS CPPFLAGS
+
+
+# Print all Cmake options values; "-LAH" means "List Advanced Help"
+cmake -B %{_vpath_builddir} -LAH
+
+%cmake_build
 
 # build selinux policy
 %if %{with galera}
@@ -859,8 +943,10 @@ pushd selinux
 make -f /usr/share/selinux/devel/Makefile %{name}-server-galera.pp
 %endif
 
+
+
 %install
-%make_install
+%cmake_install
 
 # multilib header support #1625157
 for header in mysql/server/my_config.h mysql/server/private/config.h; do
@@ -874,7 +960,7 @@ ln -s mysql_config.1.gz %{buildroot}%{_mandir}/man1/mariadb_config.1.gz
 if [ %multilib_capable ]
 then
 mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits}
-install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config
+install -p -m 0755 %{_vpath_builddir}/scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config
 # Copy manual page for multilib mysql_config; https://jira.mariadb.org/browse/MDEV-11961
 ln -s mysql_config.1 %{buildroot}%{_mandir}/man1/mysql_config-%{__isa_bits}.1
 fi
@@ -886,8 +972,8 @@ rm %{buildroot}%{_libdir}/pkgconfig/libmariadb.pc
 
 # install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files,
 # but that's pretty wacko --- see also %%{name}-file-contents.patch)
-install -p -m 644 Docs/INFO_SRC %{buildroot}%{_libdir}/%{pkg_name}/
-install -p -m 644 Docs/INFO_BIN %{buildroot}%{_libdir}/%{pkg_name}/
+install -p -m 644 %{_vpath_builddir}/Docs/INFO_SRC %{buildroot}%{_libdir}/%{pkg_name}/
+install -p -m 644 %{_vpath_builddir}/Docs/INFO_BIN %{buildroot}%{_libdir}/%{pkg_name}/
 rm -r %{buildroot}%{_datadir}/doc/%{_pkgdocdirname}/MariaDB-server-%{version}/
 
 # Logfile creation
@@ -902,33 +988,31 @@ mkdir -p %{buildroot}%{pidfiledir}
 install -p -m 0755 -d %{buildroot}%{dbdatadir}
 
 %if %{with config}
-install -D -p -m 0644 scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf
+install -D -p -m 0644 %{_vpath_builddir}/scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf
 %else
-rm scripts/my.cnf
+rm %{_vpath_builddir}/scripts/my.cnf
 %endif
 
 # use different config file name for each variant of server (mariadb / mysql)
 mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
 
-# remove SysV init script and a symlink to that, we pack our very own
-rm %{buildroot}%{_sysconfdir}/init.d/mysql
+# remove SysV init script and a symlink to that, we use systemd
 rm %{buildroot}%{_libexecdir}/rcmysql
 # install systemd unit files and scripts for handling server startup
-install -D -p -m 644 scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service
-install -D -p -m 644 scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service
-# Remove the upstream version
-rm %{buildroot}%{_tmpfilesdir}/mariadb.conf
-# Install downstream version
-install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf
+install -D -p -m 644 %{_vpath_builddir}/scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service
+install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service
+
+# Install downstream version of tmpfiles
+install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf
 %if 0%{?mysqld_pid_dir:1}
 echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf
-%endif #pid
+%endif
 
 # helper scripts for service starting
-install -p -m 755 scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir
-install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket
-install -p -m 755 scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade
-install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common
+install -p -m 755 %{_vpath_builddir}/scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir
+install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket
+install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade
+install -p -m 644 %{_vpath_builddir}/scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common
 
 # install aditional galera selinux policy
 %if %{with galera}
@@ -946,8 +1030,8 @@ ln -s unstable-tests %{buildroot}%{_datadir}/mysql-test/rh-skipped-tests.list
 
 # Client that uses libmysqld embedded server.
 # Pretty much like normal mysql command line client, but it doesn't require a running mariadb server.
-%{?with_embedded:rm %{buildroot}%{_bindir}/mysql_embedded}
-rm %{buildroot}%{_mandir}/man1/mysql_embedded.1*
+%{?with_embedded:rm %{buildroot}%{_bindir}/{mariadb-,mysql_}embedded}
+rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}embedded.1*
 # Static libraries
 rm %{buildroot}%{_libdir}/*.a
 # This script creates the MySQL system tables and starts the server.
@@ -965,13 +1049,17 @@ rm %{buildroot}%{_datadir}/%{pkg_name}/mysql.server
 rm %{buildroot}%{_datadir}/%{pkg_name}/mysqld_multi.server
 
 # Binary for monitoring MySQL performance
-# Shipped as a standalona package in Fedora
+# Shipped as a standalone package in Fedora
 rm %{buildroot}%{_bindir}/mytop
+rm %{buildroot}%{_mandir}/man1/mytop.1*
 
-# put logrotate script where it needs to be
-mkdir -p %{buildroot}%{logrotateddir}
-mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name}
-chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name}
+# Should be shipped with mariadb-connector-c
+rm %{buildroot}%{_mandir}/man1/mariadb_config.1*
+
+# for compatibility with upstream RPMs, create mysqld symlink in sbin
+mkdir -p %{buildroot}%{_sbindir}
+ln -s %{_libexecdir}/mysqld %{buildroot}%{_sbindir}/mysqld
+ln -s %{_libexecdir}/mariadbd %{buildroot}%{_sbindir}/mariadbd
 
 # copy additional docs into build tree so %%doc will find them
 install -p -m 0644 %{SOURCE6} %{basename:%{SOURCE6}}
@@ -980,39 +1068,55 @@ install -p -m 0644 %{SOURCE8} %{basename:%{SOURCE8}}
 install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}}
 install -p -m 0644 %{SOURCE71} %{basename:%{SOURCE71}}
 
+# Delete upstreams service files
+# We don't use this location of service files
+rm %{buildroot}%{_datadir}/%{pkg_name}/systemd/{mysql,mysqld}.service
+# These may come handy in a future, but right now we use our own services
+rm %{buildroot}/usr/lib/systemd/system/{mysql,mysqld}.service
+
 # install galera config file
-sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' support-files/wsrep.cnf
-install -p -m 0644 support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
+%if %{with galera}
+sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' %{_vpath_builddir}/support-files/wsrep.cnf
+install -p -m 0644 %{_vpath_builddir}/support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
+%endif
 # install the clustercheck script
 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
 touch %{buildroot}%{_sysconfdir}/sysconfig/clustercheck
-install -p -m 0755 scripts/clustercheck %{buildroot}%{_bindir}/clustercheck
+install -p -m 0755 %{_vpath_builddir}/scripts/clustercheck %{buildroot}%{_bindir}/clustercheck
 
 # remove duplicate logrotate script
-rm %{buildroot}%{logrotateddir}/mysql
+rm %{buildroot}%{_datadir}/mariadb/mariadb.logrotate
 # Remove AppArmor files
 rm -r %{buildroot}%{_datadir}/%{pkg_name}/policy/apparmor
 
-# Buildroot does not have symlink /lib --> /usr/lib
+# Buildroot does not have symlink /lib64 --> /usr/lib64
 mv %{buildroot}/%{_lib}/security %{buildroot}%{_libdir}
 
-# script without shebang: https://jira.mariadb.org/browse/MDEV-14266
-chmod -x %{buildroot}%{_datadir}/sql-bench/myisam.cnf
-
 # Add wsrep_sst_rsync_tunnel script
 install -p -m 0755 scripts/wsrep_sst_rsync_tunnel %{buildroot}%{_bindir}/wsrep_sst_rsync_tunnel
 
+# Remove systemd socket files from %%{_unitdir}
+# We ship them in %%{_datadir}, so users can try them out on their own risk
+rm %{buildroot}%{_unitdir}/%{daemon_name}*.socket
+
 # Disable plugins
 %if %{with gssapi}
-# Comment out the line to keep RHEL8 behaviour the same
-#sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/auth_gssapi.cnf
+sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/auth_gssapi.cnf
 %endif
 %if %{with cracklib}
 sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf
 %endif
 
+# Fix Galera Replication config file
+#   The replication requires cluster address upon startup (which is end-user specific).
+#   Disable it entirely, rather than have it failing out-of-the-box.
+%if %{with galera}
+sed -i 's/^wsrep_on=1/wsrep_on=0/' %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
+%endif
+
 %if %{without embedded}
 rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
+rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
 %endif
 
 
@@ -1023,6 +1127,7 @@ rm %{buildroot}%{_libdir}/libmariadb.so.*
 unlink %{buildroot}%{_libdir}/libmysqlclient.so
 unlink %{buildroot}%{_libdir}/libmysqlclient_r.so
 unlink %{buildroot}%{_libdir}/libmariadb.so
+rm %{buildroot}%{_mandir}/man3/*
 # Client plugins
 rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/{dialog.so,mysql_clear_password.so,sha256_password.so}
 %if %{with gssapi}
@@ -1033,8 +1138,8 @@ rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/auth_gssapi_client.so
 %if %{without clibrary} || %{without devel}
 rm %{buildroot}%{_bindir}/mysql_config*
 rm %{buildroot}%{_bindir}/mariadb_config
+rm %{buildroot}%{_bindir}/mariadb-config
 rm %{buildroot}%{_mandir}/man1/mysql_config*.1*
-unlink %{buildroot}%{_mandir}/man1/mariadb_config.1*
 %endif
 
 %if %{without clibrary} && %{with devel}
@@ -1053,25 +1158,19 @@ rm %{buildroot}%{_libdir}/pkgconfig/mariadb.pc
 rm %{buildroot}%{_libdir}/libmariadb*.so
 unlink %{buildroot}%{_libdir}/libmysqlclient.so
 unlink %{buildroot}%{_libdir}/libmysqlclient_r.so
-%endif # clibrary
-%endif # devel
+%endif
+%endif
 
 %if %{without client}
-rm %{buildroot}%{_bindir}/{msql2mysql,mysql,mysql_find_rows,\
-mysql_plugin,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck,\
-mysqldump,mysqlimport,mysqlshow,mysqlslap}
-rm %{buildroot}%{_mandir}/man1/{msql2mysql,mysql,mysql_find_rows,\
-mysql_plugin,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck,\
-mysqldump,mysqlimport,mysqlshow,mysqlslap}.1*
-rm %{buildroot}%{_sysconfdir}/my.cnf.d/mysql-clients.cnf
-%endif
+rm %{buildroot}%{_bindir}/msql2mysql
+rm %{buildroot}%{_bindir}/{mysql,mariadb}
+rm %{buildroot}%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}
+rm %{buildroot}%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}
 
-%if %{without tokudb}
-%else
-%if 0%{?fedora} || 0%{?rhel} > 7
-# Move the upstream file to the correct location
-mv %{buildroot}/etc/systemd/system/mariadb.service.d/tokudb.conf %{buildroot}%{_unitdir}/mariadb.service.d/tokudb.conf
-%endif
+rm %{buildroot}%{_mandir}/man1/msql2mysql.1*
+rm %{buildroot}%{_mandir}/man1/{mysql,mariadb}.1*
+rm %{buildroot}%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1*
+rm %{buildroot}%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1*
 %endif
 
 %if %{without config}
@@ -1086,26 +1185,27 @@ rm -r %{buildroot}%{_datadir}/%{pkg_name}/charsets
 rm %{buildroot}%{_datadir}/%{pkg_name}/errmsg-utf8.txt
 rm -r %{buildroot}%{_datadir}/%{pkg_name}/{english,czech,danish,dutch,estonian,\
 french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\
-polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian,hindi}
-%endif
-
-%if %{without bench}
-rm -r %{buildroot}%{_datadir}/sql-bench
+polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian,hindi,\
+bulgarian,chinese,georgian}
 %endif
 
 %if %{without test}
 %if %{with embedded}
-rm %{buildroot}%{_bindir}/{mysqltest_embedded,mysql_client_test_embedded}
-rm %{buildroot}%{_mandir}/man1/{mysqltest_embedded,mysql_client_test_embedded}.1*
+rm %{buildroot}%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded}
+rm %{buildroot}%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded}
+rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
+rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
 %endif # embedded
-rm %{buildroot}%{_bindir}/test-connect-t
 rm %{buildroot}%{_bindir}/{mysql_client_test,mysqltest}
-rm %{buildroot}%{_mandir}/man1/{mysql_client_test,my_safe_process,mysqltest}.1*
+rm %{buildroot}%{_bindir}/{mariadb-client-test,mariadb-test}
+rm %{buildroot}%{_mandir}/man1/{mysql_client_test,mysqltest,my_safe_process}.1*
+rm %{buildroot}%{_mandir}/man1/{mariadb-client-test,mariadb-test}.1*
 rm %{buildroot}%{_mandir}/man1/{mysql-test-run,mysql-stress-test}.pl.1*
-%endif # test
+rm %{buildroot}/suite/plugins/pam/mariadb_mtr
+rm %{buildroot}/suite/plugins/pam/pam_mariadb_mtr.so
+%endif
 
 %if %{without galera}
-rm %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
 rm %{buildroot}%{_sysconfdir}/sysconfig/clustercheck
 rm %{buildroot}%{_bindir}/{clustercheck,galera_new_cluster}
 rm %{buildroot}%{_bindir}/galera_recovery
@@ -1113,24 +1213,18 @@ rm %{buildroot}%{_datadir}/%{pkg_name}/systemd/use_galera_new_cluster.conf
 %endif
 
 %if %{without rocksdb}
-rm %{buildroot}%{_mandir}/man1/mysql_ldb.1*
+rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}ldb.1*
+rm %{buildroot}%{_mandir}/man1/myrocks_hotbackup.1*
+%endif
+
+%if %{without backup}
+rm %{buildroot}%{_mandir}/man1/maria{,db-}backup.1*
+rm %{buildroot}%{_mandir}/man1/mbstream.1*
 %endif
 
 %check
 %if %{with test}
 %if %runselftest
-
-# Workaround for rhbz#1618810
-OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file
-export OPENSSL_SYSTEM_CIPHERS_OVERRIDE
-OPENSSL_CONF=''
-export OPENSSL_CONF
-
-# hack to let 32- and 64-bit tests run concurrently on same build machine
-export MTR_PARALLEL=1
-# builds might happen at the same host, avoid collision
-export MTR_BUILD_THREAD=%{__isa_bits}
-
 # The cmake build scripts don't provide any simple way to control the
 # options for mysql-test-run, so ignore the make target and just call it
 # manually.  Nonstandard options chosen are:
@@ -1149,32 +1243,49 @@ export MTR_BUILD_THREAD=%{__isa_bits}
 
 (
   set -ex
+  cd %{buildroot}%{_datadir}/mysql-test
 
-  cd mysql-test
-  perl ./mysql-test-run.pl --parallel=auto --force --retry=1 --ssl \
-    --suite-timeout=5000 --testcase-timeout=100 \
-    --mysqld=--binlog-format=mixed --force-restart \
-    --shutdown-timeout=60 --max-test-fail=10 --big-test \
-    --skip-test=spider \
-%if %{ignore_testsuite_result}
-    --max-test-fail=9999 || :
-%else
-    --skip-test-list=unstable-tests
-%endif
+  export common_testsuite_arguments=" --port-base=$(( $(date +%s) % 20000 + 10000 )) --parallel=auto --force --retry=2 --suite-timeout=900 --testcase-timeout=30 --mysqld=--binlog-format=mixed --force-restart --shutdown-timeout=60 --max-test-fail=5 "
 
-# Second run for the SPIDER suites that fail with SCA (ssl self signed certificate)
-  perl ./mysql-test-run.pl --parallel=auto --force --retry=1 \
-    --suite-timeout=60 --testcase-timeout=10 \
-    --mysqld=--binlog-format=mixed --force-restart \
-    --shutdown-timeout=60 --max-test-fail=0 --big-test \
-    --skip-ssl --suite=spider,spider/bg,spider/bugfix,spider/handler \
-%if %{ignore_testsuite_result}
-    --max-test-fail=999 || :
-%endif
+  # If full testsuite has already been run on this version and we don't explicitly want the full testsuite to be run
+  if [[ "%{last_tested_version}" == "%{version}" ]] && [[ %{force_run_testsuite} -eq 0 ]]
+  then
+    # in further rebuilds only run the basic "main" suite (~800 tests)
+    echo -e "\n\nRunning just the base testsuite\n\n"
+    perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --suite=main --mem --skip-test-list=unstable-tests
+  fi
+
+  # If either this version wasn't marked as tested yet or I explicitly want to run the testsuite, run everything we have (~4000 test)
+  if [[ "%{last_tested_version}" != "%{version}" ]] || [[ %{force_run_testsuite} -ne 0 ]]
+  then
+    echo -e "running advanced testsuite"
+    perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --big-test --skip-test=spider \
+    %if %{ignore_testsuite_result}
+      --max-test-fail=9999 || :
+    %else
+      --skip-test-list=unstable-tests
+    %endif
+    # Second run for the SPIDER suites that fail with SCA (ssl self signed certificate)
+    perl ./mysql-test-run.pl $common_testsuite_arguments --skip-ssl --big-test --suite=spider,spider/bg,spider/bugfix --skip-test-list=unstable-tests \
+    %if %{ignore_testsuite_result}
+      --max-test-fail=999 || :
+    %else
+      --skip-test-list=unstable-tests
+    %endif
+  # blank line
+  fi
+
+  # There might be a dangling symlink left from the testing, remove it to not be installed
+  rm -rf ./var
+  # Remove temporary files created by the testsuite execution
+  find ./ -type f -name '*~' -exec rm {} +
 )
 
-%endif # if dry run
-%endif # with test
+# NOTE: the Spider SE has 2 more hidden testsuites "oracle" and "oracle2".
+#       however, all of the tests fail with: "failed: 12521: Can't use wrapper 'oracle' for SQL connection"
+
+%endif
+%endif
 
 
 
@@ -1183,23 +1294,18 @@ export MTR_BUILD_THREAD=%{__isa_bits}
 /usr/sbin/useradd -M -N -g mysql -o -r -d %{mysqluserhome} -s /sbin/nologin \
   -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
 
-%if %{with clibrary}
-# Can be dropped on F27 EOL
-%ldconfig_scriptlets libs
-%endif
-
-%if %{with embedded}
-# Can be dropped on F27 EOL
-%ldconfig_scriptlets embedded
-%endif
-
 %if %{with galera}
 %post server-galera
-# Do what README at support-files/policy/selinux/README and upstream page
-# http://galeracluster.com/documentation-webpages/firewallsettings.html recommend:
-semanage port -a -t mysqld_port_t -p tcp 4568 >/dev/null 2>&1 || :
+# Allow ports needed for the replication:
+# https://mariadb.com/kb/en/library/configuring-mariadb-galera-cluster/#network-ports
+#   Galera Replication Port
 semanage port -a -t mysqld_port_t -p tcp 4567 >/dev/null 2>&1 || :
 semanage port -a -t mysqld_port_t -p udp 4567 >/dev/null 2>&1 || :
+#   IST Port
+semanage port -a -t mysqld_port_t -p tcp 4568 >/dev/null 2>&1 || :
+#   SST Port
+semanage port -a -t mysqld_port_t -p tcp 4444 >/dev/null 2>&1 || :
+
 semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp >/dev/null 2>&1 || :
 %endif
 
@@ -1224,44 +1330,28 @@ fi
 %if %{with client}
 %files
 %{_bindir}/msql2mysql
-%{_bindir}/mysql
-%{_bindir}/mysql_find_rows
-%{_bindir}/mysql_plugin
-%{_bindir}/mysql_waitpid
-%{_bindir}/mysqlaccess
-%{_bindir}/mysqladmin
-%{_bindir}/mysqlbinlog
-%{_bindir}/mysqlcheck
-%{_bindir}/mysqldump
-%{_bindir}/mysqlimport
-%{_bindir}/mysqlshow
-%{_bindir}/mysqlslap
+%{_bindir}/{mysql,mariadb}
+%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}
+%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}
 
 %{_mandir}/man1/msql2mysql.1*
-%{_mandir}/man1/mysql.1*
-%{_mandir}/man1/mysql_find_rows.1*
-%{_mandir}/man1/mysql_plugin.1*
-%{_mandir}/man1/mysql_waitpid.1*
-%{_mandir}/man1/mysqlaccess.1*
-%{_mandir}/man1/mysqladmin.1*
-%{_mandir}/man1/mysqlbinlog.1*
-%{_mandir}/man1/mysqlcheck.1*
-%{_mandir}/man1/mysqldump.1*
-%{_mandir}/man1/mysqlimport.1*
-%{_mandir}/man1/mysqlshow.1*
-%{_mandir}/man1/mysqlslap.1*
+%{_mandir}/man1/{mysql,mariadb}.1*
+%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1*
+%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1*
+
 %config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-clients.cnf
 %endif
 
 %if %{with clibrary}
 %files libs
-%{_libdir}/libmariadb.so.*
+%exclude %{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so}
+%{_libdir}/libmariadb.so*
 %config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
 %endif
 
 %if %{with config}
 %files config
-# Although the default my.cnf contains only server settings, we put it in the
+# although the default my.cnf contains only server settings, we put it in the
 # common package because it can be used for client settings too.
 %dir %{_sysconfdir}/my.cnf.d
 %config(noreplace) %{_sysconfdir}/my.cnf
@@ -1275,8 +1365,8 @@ fi
 %if %{with clibrary}
 %{_libdir}/%{pkg_name}/plugin/dialog.so
 %{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so
-%endif # clibrary
-%endif # common
+%endif
+%endif
 
 %if %{with errmsg}
 %files errmsg
@@ -1305,6 +1395,9 @@ fi
 %lang(es) %{_datadir}/%{pkg_name}/spanish
 %lang(sv) %{_datadir}/%{pkg_name}/swedish
 %lang(uk) %{_datadir}/%{pkg_name}/ukrainian
+%lang(bg) %{_datadir}/%{pkg_name}/bulgarian
+%lang(zh) %{_datadir}/%{pkg_name}/chinese
+%lang(ka) %{_datadir}/%{pkg_name}/georgian
 %endif
 
 %if %{with galera}
@@ -1323,33 +1416,42 @@ fi
 %files server
 %doc README.wsrep_sst_rsync_tunnel
 
-%{_bindir}/aria_chk
-%{_bindir}/aria_dump_log
-%{_bindir}/aria_ftdump
-%{_bindir}/aria_pack
-%{_bindir}/aria_read_log
+%{_bindir}/aria_{chk,dump_log,ftdump,pack,read_log}
 %{_bindir}/mariadb-service-convert
 %{_bindir}/myisamchk
 %{_bindir}/myisam_ftdump
 %{_bindir}/myisamlog
 %{_bindir}/myisampack
 %{_bindir}/my_print_defaults
-%{_bindir}/mysql_install_db
-%{_bindir}/mysql_secure_installation
-%{_bindir}/mysql_tzinfo_to_sql
-%{_bindir}/mysqld_safe
-%{_bindir}/mysqld_safe_helper
+
+%{_bindir}/mariadb-conv
+
+%{_bindir}/mysql_{install_db,secure_installation,tzinfo_to_sql}
+%{_bindir}/mariadb-{install-db,secure-installation,tzinfo-to-sql}
+%{_bindir}/{mysqld_,mariadbd-}safe
+%{_bindir}/{mysqld_safe_helper,mariadbd-safe-helper}
+
 %{_bindir}/innochecksum
 %{_bindir}/replace
 %{_bindir}/resolve_stack_dump
 %{_bindir}/resolveip
+%if %{with galera}
 # wsrep_sst_common should be moved to /usr/share/mariadb: https://jira.mariadb.org/browse/MDEV-14296
 %{_bindir}/wsrep_*
+%endif
 
 %config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
 %config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset
+%config(noreplace) %{_sysconfdir}/my.cnf.d/spider.cnf
 
-%{_libexecdir}/mysqld
+%config(noreplace) %{_sysconfdir}/my.cnf.d/provider_lz4.cnf
+#%config(noreplace) %{_sysconfdir}/my.cnf.d/provider_lzma.cnf
+
+#%config(noreplace) %{_sysconfdir}/my.cnf.d/hashicorp_key_management.cnf
+
+%{_sbindir}/mysqld
+%{_sbindir}/mariadbd
+%{_libexecdir}/{mysqld,mariadbd}
 
 %{_libdir}/%{pkg_name}/INFO_SRC
 %{_libdir}/%{pkg_name}/INFO_BIN
@@ -1359,27 +1461,24 @@ fi
 
 %dir %{_libdir}/%{pkg_name}
 %dir %{_libdir}/%{pkg_name}/plugin
-%{_libdir}/security/pam_user_map.so
-%config(noreplace) %{_sysconfdir}/security/user_map.conf
 %{_libdir}/%{pkg_name}/plugin/*
 %{?with_oqgraph:%exclude %{_libdir}/%{pkg_name}/plugin/ha_oqgraph.so}
 %{?with_connect:%exclude %{_libdir}/%{pkg_name}/plugin/ha_connect.so}
 %{?with_cracklib:%exclude %{_libdir}/%{pkg_name}/plugin/cracklib_password_check.so}
 %{?with_rocksdb:%exclude %{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so}
-%{?with_tokudb:%exclude %{_libdir}/%{pkg_name}/plugin/ha_tokudb.so}
 %{?with_gssapi:%exclude %{_libdir}/%{pkg_name}/plugin/auth_gssapi.so}
 %{?with_sphinx:%exclude %{_libdir}/%{pkg_name}/plugin/ha_sphinx.so}
-%{?with_cassandra:%exclude %{_libdir}/%{pkg_name}/plugin/ha_cassandra.so}
 %if %{with clibrary}
 %exclude %{_libdir}/%{pkg_name}/plugin/dialog.so
 %exclude %{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so
 %endif
 
-%{_mandir}/man1/aria_chk.1*
-%{_mandir}/man1/aria_dump_log.1*
-%{_mandir}/man1/aria_ftdump.1*
-%{_mandir}/man1/aria_pack.1*
-%{_mandir}/man1/aria_read_log.1*
+# PAM plugin; moved to a standalone sub-package
+%exclude %{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so}
+%exclude %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir
+%exclude %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool
+
+%{_mandir}/man1/aria_{chk,dump_log,ftdump,pack,read_log,s3_copy}.1*
 %{_mandir}/man1/galera_new_cluster.1*
 %{_mandir}/man1/galera_recovery.1*
 %{_mandir}/man1/mariadb-service-convert.1*
@@ -1388,24 +1487,29 @@ fi
 %{_mandir}/man1/myisampack.1*
 %{_mandir}/man1/myisam_ftdump.1*
 %{_mandir}/man1/my_print_defaults.1*
-%{_mandir}/man1/mysql.server.1*
-%{_mandir}/man1/mysql_install_db.1*
-%{_mandir}/man1/mysql_secure_installation.1*
-%{_mandir}/man1/mysql_tzinfo_to_sql.1*
-%{_mandir}/man1/mysqld_safe.1*
-%{_mandir}/man1/mysqld_safe_helper.1*
+
+%{_mandir}/man1/mariadb-conv.1*
+
+%{_mandir}/man1/mysql_{install_db,secure_installation,tzinfo_to_sql}.1*
+%{_mandir}/man1/mariadb-{install-db,secure-installation,tzinfo-to-sql}.1*
+%{_mandir}/man1/{mysqld_,mariadbd-}safe.1*
+%{_mandir}/man1/{mysqld_safe_helper,mariadbd-safe-helper}.1*
+
 %{_mandir}/man1/innochecksum.1*
 %{_mandir}/man1/replace.1*
 %{_mandir}/man1/resolveip.1*
 %{_mandir}/man1/resolve_stack_dump.1*
-%{_mandir}/man8/mysqld.8*
+%{_mandir}/man8/{mysqld,mariadbd}.8*
 %{_mandir}/man1/wsrep_*.1*
 
+%{_mandir}/man1/mysql.server.1*
+
+%{_datadir}/%{pkg_name}/mini-benchmark
 %{_datadir}/%{pkg_name}/fill_help_tables.sql
-%{_datadir}/%{pkg_name}/install_spider.sql
 %{_datadir}/%{pkg_name}/maria_add_gis_sp.sql
 %{_datadir}/%{pkg_name}/maria_add_gis_sp_bootstrap.sql
 %{_datadir}/%{pkg_name}/mysql_system_tables.sql
+%{_datadir}/%{pkg_name}/mysql_sys_schema.sql
 %{_datadir}/%{pkg_name}/mysql_system_tables_data.sql
 %{_datadir}/%{pkg_name}/mysql_test_data_timezone.sql
 %{_datadir}/%{pkg_name}/mysql_performance_tables.sql
@@ -1420,7 +1524,9 @@ fi
 %doc %{_datadir}/%{name}-server/groonga-normalizer-mysql/README.md
 %doc %{_datadir}/%{name}-server/groonga/README.md
 %endif
+%if %{with galera}
 %{_datadir}/%{pkg_name}/wsrep.cnf
+%endif
 %{_datadir}/%{pkg_name}/wsrep_notify
 %dir %{_datadir}/%{pkg_name}/policy
 %dir %{_datadir}/%{pkg_name}/policy/selinux
@@ -1428,13 +1534,13 @@ fi
 %{_datadir}/%{pkg_name}/policy/selinux/mariadb-server.*
 %{_datadir}/%{pkg_name}/policy/selinux/mariadb.*
 %{_datadir}/%{pkg_name}/systemd/mariadb.service
+%{_datadir}/%{pkg_name}/systemd/mariadb*@.socket
 # mariadb@ is installed only when we have cmake newer than 3.3
 %if 0%{?fedora} || 0%{?rhel} > 7
 %{_datadir}/%{pkg_name}/systemd/mariadb@.service
 %endif
 
 %{_unitdir}/%{daemon_name}*
-%{?with_tokudb:%exclude %{_unitdir}/mariadb.service.d/tokudb.conf}
 
 %{_libexecdir}/mysql-prepare-db-dir
 %{_libexecdir}/mysql-check-socket
@@ -1446,7 +1552,7 @@ fi
 %attr(0750,mysql,mysql) %dir %{logfiledir}
 # This does what it should.
 # RPMLint error "conffile-without-noreplace-flag /var/log/mariadb/mariadb.log" is false positive.
-%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile}
+%attr(0660,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile}
 %config(noreplace) %{logrotateddir}/%{daemon_name}
 
 %{_tmpfilesdir}/%{name}.conf
@@ -1460,9 +1566,9 @@ fi
 
 %if %{with backup}
 %files backup
-%{_bindir}/mariabackup
+%{_bindir}/maria{,db-}backup
 %{_bindir}/mbstream
-%{_mandir}/man1/mariabackup.1*
+%{_mandir}/man1/maria{,db-}backup.1*
 %{_mandir}/man1/mbstream.1*
 %endif
 
@@ -1470,21 +1576,11 @@ fi
 %files rocksdb-engine
 %config(noreplace) %{_sysconfdir}/my.cnf.d/rocksdb.cnf
 %{_bindir}/myrocks_hotbackup
-%{_bindir}/mysql_ldb
+%{_bindir}/{mysql_,mariadb-}ldb
 %{_bindir}/sst_dump
 %{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so
-%{_mandir}/man1/mysql_ldb.1*
-%endif
-
-%if %{with tokudb}
-%files tokudb-engine
-%{_bindir}/tokuftdump
-%{_bindir}/tokuft_logprint
-%{_mandir}/man1/tokuftdump.1*
-%{_mandir}/man1/tokuft_logprint.1*
-%config(noreplace) %{_sysconfdir}/my.cnf.d/tokudb.cnf
-%{_libdir}/%{pkg_name}/plugin/ha_tokudb.so
-%{_unitdir}/mariadb.service.d/tokudb.conf
+%{_mandir}/man1/{mysql_,mariadb-}ldb.1*
+%{_mandir}/man1/myrocks_hotbackup.1*
 %endif
 
 %if %{with gssapi}
@@ -1493,6 +1589,16 @@ fi
 %config(noreplace) %{_sysconfdir}/my.cnf.d/auth_gssapi.cnf
 %endif
 
+%if %{with pam}
+%files pam
+%{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so}
+%attr(0755,root,root) %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir
+# SUID-to-root binary. Access MUST be restricted (https://jira.mariadb.org/browse/MDEV-25126)
+%attr(4750,root,mysql) %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool
+%{_libdir}/security/pam_user_map.so
+%config(noreplace) %{_sysconfdir}/security/user_map.conf
+%endif
+
 %if %{with sphinx}
 %files sphinx-engine
 %{_libdir}/%{pkg_name}/plugin/ha_sphinx.so
@@ -1510,46 +1616,36 @@ fi
 %{_libdir}/%{pkg_name}/plugin/ha_connect.so
 %endif
 
-%if %{with cassandra}
-%files cassandra-engine
-%config(noreplace) %{_sysconfdir}/my.cnf.d/cassandra.cnf
-%{_libdir}/%{pkg_name}/plugin/ha_cassandra.so
-%endif
-
 %files server-utils
 # Perl utilities
-%{_bindir}/mysql_convert_table_format
-%{_bindir}/mysql_fix_extensions
-%{_bindir}/mysql_setpermission
-%{_bindir}/mysqldumpslow
-%{_bindir}/mysqld_multi
-%{_bindir}/mysqlhotcopy
-%{_mandir}/man1/mysql_convert_table_format.1*
-%{_mandir}/man1/mysql_fix_extensions.1*
-%{_mandir}/man1/mysqldumpslow.1*
-%{_mandir}/man1/mysqld_multi.1*
-%{_mandir}/man1/mysqlhotcopy.1*
-%{_mandir}/man1/mysql_setpermission.1*
+%{_bindir}/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission}
+%{_bindir}/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission}
+%{_bindir}/{mysqld_,mariadbd-}multi
+
+%{_mandir}/man1/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission}.1*
+%{_mandir}/man1/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission}.1*
+%{_mandir}/man1/{mysqld_,mariadbd-}multi.1*
 # Utilities that can be used remotely
-%{_bindir}/mysql_upgrade
+%{_bindir}/{mysql_,mariadb-}upgrade
 %{_bindir}/perror
-%{_mandir}/man1/mysql_upgrade.1*
+%{_mandir}/man1/{mysql_,mariadb-}upgrade.1*
 %{_mandir}/man1/perror.1*
 
 %if %{with devel}
 %files devel
 %{_includedir}/*
 %{_datadir}/aclocal/mysql.m4
-%{_libdir}/pkgconfig/mariadb.pc
+%{_libdir}/pkgconfig/*mariadb.pc
 %if %{with clibrary}
+%{_mandir}/man3/*
 %{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so}
 %{_bindir}/mysql_config*
 %{_bindir}/mariadb_config*
+%{_bindir}/mariadb-config
 %{_libdir}/libmariadb.so
 %{_libdir}/libmysqlclient.so
 %{_libdir}/libmysqlclient_r.so
 %{_mandir}/man1/mysql_config*
-%{_mandir}/man1/mariadb_config*
 %endif
 %endif
 
@@ -1562,164 +1658,319 @@ fi
 %{_libdir}/libmariadbd.so
 %endif
 
-%if %{with bench}
-%files bench
-%{_datadir}/sql-bench
-%doc %{_datadir}/sql-bench/README
-%endif
-
 %if %{with test}
 %files test
 %if %{with embedded}
 %{_bindir}/test-connect-t
-%{_bindir}/mysql_client_test_embedded
-%{_bindir}/mysqltest_embedded
-%{_mandir}/man1/mysql_client_test_embedded.1*
-%{_mandir}/man1/mysqltest_embedded.1*
+%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded}
+%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded}
+%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
+%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
 %endif
-%{_bindir}/mysql_client_test
+%{_bindir}/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test}
 %{_bindir}/my_safe_process
-%{_bindir}/mysqltest
 %attr(-,mysql,mysql) %{_datadir}/mysql-test
-%{_mandir}/man1/mysql_client_test.1*
+%{_mandir}/man1/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test}.1*
 %{_mandir}/man1/my_safe_process.1*
-%{_mandir}/man1/mysqltest.1*
 %{_mandir}/man1/mysql-stress-test.pl.1*
 %{_mandir}/man1/mysql-test-run.pl.1*
 %endif
 
 %changelog
-* Thu Jun 22 2023 Anton Bobrov <abobrov@redhat.com> - 3:10.3.39-1
-- Rebase to 10.3.39
-- CVEs fixed:
-  CVE-2022-47015, CVE-2018-25032, CVE-2022-32091, CVE-2022-32084
+* Sat Nov 16 2024 Michal Schorm <mschorm@redhat.com> - 3:10.11.10-1
+- Rebase to 10.11.10
 
-* Thu Jun 30 2022 Zuzana Miklankova <zmiklank@redhat.com> - 3:10.3.35-1
-- Rebase to 10.3.35
+* Tue Aug 13 2024 Michal Schorm <mschorm@redhat.com> - 3:10.11.9-1
+- Rebase to 10.11.9
 
-* Thu Jun 30 2022 Zuzana Miklankova <zmiklank@redhat.com> - 3:10.3.34-1
-- Rebase to 10.3.34
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.11.6-1
+- Rebase to 10.11.6
 
-* Mon Jan 17 2022 Zuzana Miklankova <zmiklank@redhat.com> - 3:10.3.32-2
-- Add delaycompress option to the logrotate script
-- Resolves: rhbz:#2015580
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.10.7-1
+- Rebase to 10.10.7
 
-* Wed Jan 12 2022 Zuzana Miklankova <zmiklank@redhat.com> - 3:10.3.32-1
-- Rebase to 10.3.32
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.9.8-1
+- Rebase to 10.9.8
 
-* Tue Jan 11 2022 Zuzana Miklankova <zmiklank@redhat.com> - 3:10.3.31-1
-- Rebase to 10.3.31
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.8.8-1
+- Rebase to 10.8.8
 
-* Fri Sep 24 2021 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.30-1
-- Rebase to 10.3.30
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.7.8-1
+- Rebase to 10.7.8
 
-* Mon Aug 09 2021 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.29-2
+* Mon Dec 18 2023 Michal Schorm <mschorm@redhat.com> - 3:10.6.16-1
+- Rebase to 10.6.16
+
+* Mon Sep 04 2023 Michal Schorm <mschorm@redhat.com> - 3:10.5.22-1
+- Rebase to 10.5.22
+
+* Wed Jul 26 2023 Michal Schorm <mschorm@redhat.com> - 3:10.5.21-1
+- Rebase to version 10.5.21
+
+* Wed May 31 2023 Siddhesh Poyarekar <siddhesh@redhat.com> - 3:10.5.20-2
+- Use _fortify_level to disable fortification in debug builds
+
+* Tue May 30 2023 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.20-1
+- Rebase to version 10.5.20
+
+* Wed Nov 16 2022 Michal Schorm <mschorm@redhat.com> - 3:10.5.18-1
+- Rebase to 10.5.18
+- OpenSSL 3 patch upstreamed
+
+* Mon Jun 13 2022 Michal Schorm <mschorm@redhat.com> - 3:10.5.16-2
+- Release bump for rebuild
+
+* Mon May 23 2022 Michal Schorm <mschorm@redhat.com> - 3:10.5.16-1
+- Rebase to 10.5.16
+
+* Sun Feb 20 2022 Michal Schorm <mschorm@redhat.com> - 3:10.5.15-1
+- Rebase to 10.5.15
+
+* Tue Jan 11 2022 Michal Schorm <mschorm@redhat.com> - 3:10.5.13-1
+- Rebase to 10.5.13
+- Add wsrep_sst_rsync_tunnel script
+
+* Tue Aug 24 2021 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.12-1
+- Rebase to 10.5.12
+
+* Thu Aug 19 2021 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.11-1
+- Rebase to 10.5.11
+
+* Mon Aug 16 2021 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.10-2
 - Set user_map.conf file to be noreplace config file
-- Resolves: rhbz#1989534
+- Resolves: rhbz#1989621
 
-* Tue May 05 2021 Michal Schorm <mschorm@redhat.com> - 3:10.3.29-1
-- Rebase to 10.3.29
+* Tue May 11 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.10-1
+- Rebase to 10.5.10
 
-* Wed Mar 24 2021 Michal Schorm <mschorm@redhat.com> - 3:10.3.28-1
-- Rebase to 10.3.28
+* Mon May 10 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.9-2
+- Modify the upstream sources
 
-* Thu Dec 03 2020 Michal Schorm <mschorm@redhat.com> - 3:10.3.27-3
-- Remove mariadb_rpl.h from includedir
-  This file is shipped in mariadb-connector-c package
-- Require matching version of mariadb-connector-c package
+* Mon Mar 22 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.9-1
+- Rebase to 10.5.9
 
-* Wed Nov 25 2020 Michal Schorm <mschorm@redhat.com> - 3:10.3.27-2
-- Disable building of the ed25519 client plugin.
-  From now on it will be shipped by 'mariadb-connector-c' package
+* Fri Mar 19 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.8-4
+- Move the PAM plugin to a standalone sub-package
 
-* Thu Nov 12 2020 Michal Schorm <mschorm@redhat.com> - 3:10.3.27-1
-- Rebase to 10.3.27
-- mariadb-debug_build.patch is no more needed, upstream did the changes:
-  https://github.com/MariaDB/server/commit/31eaa2029f3c2a4f8e5609ce8b87682286238d9a#diff-32766783af7cac683980224d63c59929
-  https://github.com/MariaDB/server/commit/23c6fb3e6231b8939331e2d9f157092f24ed8f4f#diff-78f3162f137407db5240950beb2bcd7c
+* Thu Mar 18 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.8-3
+- Fix permissions of the PAMv2 plugin files
 
-* Fri May 15 2020 Michal Schorm <mschorm@redhat.com> - 3:10.3.23-1
-- Rebase to 10.3.23
+* Tue Feb 16 2021 Michal Schorm <mschorm@redhat.com> - 3:10.5.8-2
+- Bump release after several commits cherry-picked from Fedora Rawhide
+
+* Wed Nov 11 2020 Michal Schorm <mschorm@redhat.com> - 3:10.5.8-1
+- Rebase to 10.5.8
+
+* Fri Nov 06 2020 Michal Schorm <mschorm@redhat.com> - 3:10.5.7-1
+- Rebase to 10.5.7
+
+* Mon Sep 21 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.5-1
+- Rebase to 10.5.5
+- Fix mariadb-ownsetup
+- Add manual for aria_s3_copy
+
+* Wed Sep 16 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.4-1
+- Rebase to 10.5.4
+- Add spider.cnf to the server config files
+
+* Mon Sep 14 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.5.3-1
+- Rebase to 10.5.3
+
+* Fri Sep 11 2020 Michal Schorm <mschorm@redhat.com> - 3:10.5.2-1
+- Test rebase to 10.5.2 - Beta
+- TokuDB SE has been deprecated
+
+* Thu Sep 10 2020 Michal Schorm <mschorm@redhat.com> - 3:10.5.1-1
+- Test rebase to 10.5.1 - Beta
+
+* Thu Sep 10 2020 Michal Schorm <mschorm@redhat.com> - 3:10.5.0-1
+- Test rebase to 10.5.0 - Alpha
+
+* Sun Sep 06 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.14-3
+- Resolves: #1851605
+
+* Thu Sep 03 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.14-2
+- Resolves: #1873999, #1874446
+
+* Thu Aug 20 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.14-1
+- Rebase to 10.4.14
+
+* Tue Aug 18 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.13-7
+- Do CMake out-of-source builds
+- Force the CMake change regarding the in-source builds also to F31 and F32
+- Use CMake macros instead of cmake & make direct commands
+- %%cmake macro covers the %%{set_build_flags}, so they are not needed
+  Other changes to compile flags must be specified *after* the %%cmake macro
+
+* Wed Aug 05 2020 Jeff Law <law@redhat.com> - 3:10.4.13-6
+- Disable LTO
+
+* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.4.13-5
+- Second attempt - Rebuilt for
+  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.4.13-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Tue Jul 14 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.13-3
 - Make conflicts between corresponding mariadb and mysql packages explicit
 - Get rid of the Conflicts macro, it was intended to mark conflicts with
   *upstream* packages
-  Resolves: #1853159
 
-* Mon Mar 30 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.22-1
-- Rebase to 10.3.22
+* Fri Jun 05 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.13-2
+- Extend Perl "Requires" filtering to wsrep
+  Resolves: #1845376
 
-* Fri Jan 10 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.21-1
+* Fri Jun 05 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.13-1
+- Rebase to 10.4.13
+
+* Sun May 24 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.4.12-6
+- Remove mariadb_rpl.h from includedir to prevent conflict with connector-c's libraries
+
+* Thu Apr 02 2020 Björn Esser <besser82@fedoraproject.org> - 3:10.4.12-5
+- Fix string quoting for rpm >= 4.16
+
+* Thu Mar 26 2020 Jitka Plesnikova <jplesnik@redhat.com> - 3:10.4.12-4
+- Add perl dependencies needed for tests
+
+* Mon Mar 16 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.12-3
+- Rebase mariadb-connector-c git submodule to commit fbf1db6
+  For fix: https://jira.mariadb.org/browse/CONC-441
+
+* Tue Mar 10 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.12-2
+- Update the fix for building in the debug mode
+
+* Thu Feb 06 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.12-1
+- Rebase to 10.4.12
+
+* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.4.11-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
+
+* Fri Jan 17 2020 Michal Schorm <mschorm@redhat.com> - 3:10.4.11-1
+- Rebase to 10.4.11
+  Related: #1756468
+- Remove 'bench' subpackage. Upstream no longer maintains it.
+- Use Valgrind for debug builds
+- Remove ancient obsoletions
+- Tweak build flags
+- Add patch for auth_pam_tool directory
+
+* Fri Jan 10 2020 Michal Schorm <mschorm@redhat.com> - 3:10.3.21-1
 - Rebase to 10.3.21
 
-* Thu Dec 05 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.20-2
+* Mon Nov 18 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.20-3
 - Change path of groonga's packaged files
 - Fix bz#1763287
 
-* Thu Dec 05 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.20-1
-- Rebase to 10.3.20
-- NOTE: 10.3.19 was deleted by upstream
+* Tue Nov 12 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.20-2
+- Rebuild on top fo new mariadb-connector-c
 
-* Tue Dec 03 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.18-1
+* Mon Nov 11 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.20-1
+- Rebase to 10.3.20
+
+* Wed Nov 06 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.19-1
+- Rebase to 10.3.19
+
+* Thu Oct 31 2019 Carl George <carl@george.computer> - 3:10.3.18-1
 - Rebase to 10.3.18
 
-* Tue Dec 03 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3:10.3.17-2
+* Wed Sep 11 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.17-3
+- Disable building of the ed25519 client plugin.
+  From now on it will be shipped by 'mariadb-connector-c' package
+
+* Fri Sep 06 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.17-2
 - Fix the debug build
 
 * Thu Aug 01 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.17-1
 - Rebase to 10.3.17
-  Resolves: #1711265
-  Resolves: #1701687
-- Add patch for server pkgconfig file location
-- Use logrotatedir macro on one more spot
+
+* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.3.16-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* Tue Jun 18 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.16-1
+- Rebase to 10.3.16
+- Added patch for armv7hl builds of spider SE
+
+* Tue Jun 11 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.15-1
+- Rebase to 10.3.15
+- CVEs fixed:
+  CVE-2019-2510 CVE-2019-2537
+- CVEs fixed:
+  CVE-2019-2614 CVE-2019-2627 CVE-2019-2628
+
+* Tue Jun 11 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-15
+- Remove Cassandra subpackage; it is no longer developed
+
+* Thu Mar 21 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-14
 - Fix building of TokuDB with Jemalloc 5
 - Fix building with / without lz4
-- Fix "ggsapi" -> "gssapi" typo but keep the broken behaviour
-- Control building of the CACHING_SHA2_PASSWORD plugin
-- Fix the license tag
-  Resolves: #1702707
+
+* Thu Mar 21 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-13
+- Add patch for mysqld_safe --dry-run
+
+* Wed Mar 20 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-12
+- Add patch for server pkgconfig file location
+
+* Sat Feb 23 2019 Pavel Raiskup <praiskup@redhat.com> - 3:10.3.12-11
+- conditionally depend on selinux-policy-targeted again (rhbz#1665643)
+
+* Mon Feb 11 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-10
+- Disable the requirement of mysql-selinux, until its bug is solved for good; #1665643
+
+* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.3.12-9
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Wed Jan 30 2019 Honza Horak <hhorak@redhat.com> - 3:10.3.12-8
+- Fix several SSL tests that failed because of different SSL cipher expectation
+
+* Wed Jan 23 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-7
+- Fix TokuDB Jemalloc ld_preload
+  Resolves: #1668375
+- Tweak macros usage
+
+* Sat Jan 19 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-6
+- Enable mysql-selinux requirement
+- Tweak the testsuite execution, speed up the testsuite on rebuilds
+- Change weak dependency of RocksDB and TokuDB storage engines
+  from Recommends to Suggests
+- Add "Suggests" weak dependencies to more storage engines
+
+* Wed Jan 16 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-5
+- Tweak handling of the mysql-selinux requirement, leave disabled due to #1665643
+
+* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 3:10.3.12-4
+- Rebuilt for libcrypt.so.2 (#1666033)
+
+* Fri Jan 11 2019 Kevin Fenzi <kevin@scrye.com> - 3:10.3.12-3
+- Drop mysql-selinux recommends for now due to bug #1665643
+
+* Wed Jan 09 2019 Honza Horak <hhorak@redhat.com> - 3:10.3.12-2
+- Use specific python shebang
+
+* Tue Jan 08 2019 Michal Schorm <mschorm@redhat.com> - 3:10.3.12-1
+- Rebase to 10.3.12
+- Disable building of the caching_sha2_password plugin, it is shipped
+  by 'mariadb-connector-c'
+- Remove libmariadb.pc, is it shipped by 'mariadb-connector-c'
 
 * Mon Dec 10 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.11-1
 - Rebase to 10.3.11
-- Remove README.mysql-cnf as we don't ship example configuration files anymore
-  Resolves: #1653318
 - CVEs fixed:
   CVE-2018-3282, CVE-2016-9843, CVE-2018-3174, CVE-2018-3143, CVE-2018-3156
   CVE-2018-3251, CVE-2018-3185, CVE-2018-3277, CVE-2018-3162, CVE-2018-3173
   CVE-2018-3200, CVE-2018-3284
 
-* Fri Oct 12 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.10-3
-- Fix "-fstack-protector-strong" static analysis errors
-  Resolves: #1624139
-- Add wsrep_sst_rsync_tunnel script, add README
-  Resolves: #1650463
-- Fix few covscan issues
-  Resolves: #1649707
-- Fix galera_new_cluster script
-  Resolves: #1641663
-
-* Fri Oct 12 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.10-2
-- Fix RPMDiff errors - license and path macros
-  Resolves: #1638720
-
 * Fri Oct 05 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.10-1
 - Rebase to 10.3.10
-  Resolves: #1637034
 
-* Wed Aug 22 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.9-1
+* Tue Sep 04 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.9-2
+- Fix parallel installability of x86_64 and i686 devel packages
+
+* Mon Aug 20 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.9-1
 - Rebase to 10.3.9
-- Add workaround for short SSL certificates
-- Fix parallel installability for x86_64 and i686 devel packages
-- CVEs fixed: #1603531
-  CVE-2018-3058 CVE-2018-3063 CVE-2018-3064 CVE-2018-3066
 
-* Mon Aug 13 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.8-6
-- Use openssl-devel instead of pkgconfig(openssl)
-- Enable conflicts against mysql (instead of community-mysql)
-  Related: #1581034
-
-* Sun Aug 12 2018 Honza Horak <hhorak@redhat.com> - 3:10.3.8-5
-- Define explicit conflicts with mysql
-  Resolves: #1581034
+* Fri Aug 10 2018 Petr Lautrbach <plautrba@redhat.com> - 3:10.3.8-5
+- Update mariadb-server-galera sub-package to require the correct package with /usr/sbin/semanage
 
 * Wed Jul 25 2018 Honza Horak <hhorak@redhat.com> - 3:10.3.8-4
 - Do not build config on systems where mariadb-connector-c-config exists instead
@@ -1728,6 +1979,9 @@ fi
 - Move config files mysql-clients.cnf and enable_encryption.preset to correct
   sub-packages, similar to what upstream does
 
+* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3:10.3.8-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
 * Tue Jul 03 2018 Michal Schorm <mschorm@redhat.com> - 3:10.3.8-1
 - Rebase to 10.3.8
 - Build TokuDB with jemalloc