SHA256
1
0
forked from pool/mariadb

- Remove func_math_tests_MDEV-26645.diff as patch for s390x/ppc64le

- Add s390x to the constraints file

OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=321
This commit is contained in:
Antonio Teixeira 2024-07-17 13:34:25 +00:00 committed by Git OBS Bridge
commit 770b8d669b
28 changed files with 6428 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

74
README.debug Normal file
View File

@ -0,0 +1,74 @@
Debugging mysqld crashes
========================
Author: Michal Marek <mmarek@suse.cz>
Last modified: 2014-11-21
Contents
--------
1) Query log
2) Coredumps and Backtraces
3) Trace files
In case your MySQL server crashes, here are some hints on what to
include in a bugreport at https://bugzilla.novell.com/ . Please report
there only bugs in the MySQL packages packaged by Novell/SUSE, bugs in
binaries / source provided by MySQL AB should be reported at
http://bugs.mysql.com/ .
1) Query log
------------
Note: Skip this chapter if you already have an exact query that
crashes the server
To find out which query possibly crashed the server, add the following
line to your /etc/my.cnf into section [mysqld]:
log=/var/lib/mysql/mysqld-query.log
Mysqld then will, at some performance cost, log all queries into this
file. After a server crash, you can examine the queries from the time it
crashed and try to reproduce the crash with single queries (this might
not allways work, eg. if the crash is caused by some race condition).
Note that this log file may become extremly large, so if you decide to
attach it whole to the bugzilla, don't forget to
xz -k9 /var/lib/mysql/mysqld-query.log
and attach the xzipped file instead.
2) Coredumps and Backtraces
---------------------------
Another valuable information for the developers is the backtrace. The
easies way to get one is to let mysqld produce a coredump. Add the
following line to your /etc/my.cnf into section [mysqld]:
core-file
The core file will be written to the /var/lib/mysql/ directory. I
suggest setting the kernel variable kernel.core_uses_pid to 1
sysctl -w kernel.core_uses_pid=1
so that the coredumps don't overwrite each other if you experience
multiple crashes.
After you got the core file, install the gdb and mysql-debuginfo
packages and run
gdb /usr/sbin/mysqld /var/lib/mysql/<core>
(gdb) bt
Replace the <core> with the actual name of the coredump.
3) Trace files
--------------
The trace file will contain various debug information and function
calls/returns and will become _extremly_ huge after a while, so don't
attach it to bugzilla unless requested.
Add the following line to your /etc/my.cnf into section [mysqld]:
stack-trace
The trace file will be then written to /var/lib/mysql directory.

22
README.install Normal file
View File

@ -0,0 +1,22 @@
You have just installed MariaDB server for the first time.
You can start it via:
systemctl start mariadb
or
rcmysql start
During the first start, empty database will be created for you automatically.
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER!
To do so, start the server and run the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h <hostname> password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

36
_constraints Normal file
View File

@ -0,0 +1,36 @@
<constraints>
<hardware>
<disk>
<size unit="G">18</size>
</disk>
<memory>
<size unit="G">8</size>
</memory>
</hardware>
<overwrite>
<conditions>
<arch>i586</arch>
<arch>x86_64</arch>
<arch>aarch64</arch>
<arch>ppc</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">10</size>
</physicalmemory>
</hardware>
</overwrite>
<overwrite>
<conditions>
<arch>ppc64le</arch>
<arch>s390x</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">16</size>
</physicalmemory>
</hardware>
</overwrite>
</constraints>

13
fix-pamdir.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 877b147bc6e..f025aec78cb 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -163,7 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
-SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")
+SET(INSTALL_PAMDIR_RPM "${INSTALL_LIBDIR_RPM}/security")
SET(INSTALL_PAMDATADIR_RPM "/etc/security")
#

View File

@ -0,0 +1,71 @@
https://jira.mariadb.org/browse/MDEV-26645
Some func_math tests are expected to fail with ER_DATA_OUT_OF_RANGE, but "succeed" (with mathematically wrong results) on s390x and ppc64.
Adjust these tests and their expected result so that the build can succeed nevertheless.
(Remove this patch when the upstream bug is fixed.)
Index: mysql-test/main/func_math.test
===================================================================
--- mysql-test/main/func_math.test.orig 2021-08-03 16:48:39.000000000 +0200
+++ mysql-test/main/func_math.test 2021-10-31 00:25:19.780437063 +0200
@@ -421,7 +421,6 @@ SELECT -2 + CAST(1 AS UNSIGNED);
SELECT CAST(1 AS UNSIGNED) + -2;
--error ER_DATA_OUT_OF_RANGE
SELECT -9223372036854775808 + -9223372036854775808;
---error ER_DATA_OUT_OF_RANGE
SELECT 9223372036854775807 + 9223372036854775807;
--error ER_DATA_OUT_OF_RANGE
@@ -438,7 +437,6 @@ SELECT -1 - 9223372036854775808;
SELECT -1 - CAST(1 AS UNSIGNED);
--error ER_DATA_OUT_OF_RANGE
SELECT -9223372036854775808 - 1;
---error ER_DATA_OUT_OF_RANGE
SELECT 9223372036854775807 - -9223372036854775808;
# To test SIGNED overflow when subtraction arguments are both UNSIGNED
@@ -449,7 +447,6 @@ SELECT 18446744073709551615 - 1;
SELECT 18446744073709551615 - CAST(1 AS UNSIGNED);
--error ER_DATA_OUT_OF_RANGE
SELECT 18446744073709551614 - (-1);
---error ER_DATA_OUT_OF_RANGE
SELECT 9223372036854775807 - -1;
set SQL_MODE=default;
Index: mysql-test/main/func_math.result
===================================================================
--- mysql-test/main/func_math.result.orig 2021-08-03 16:48:39.000000000 +0200
+++ mysql-test/main/func_math.result 2021-10-31 09:22:47.195407958 +0100
@@ -629,7 +629,8 @@ ERROR 22003: BIGINT UNSIGNED value is ou
SELECT -9223372036854775808 + -9223372036854775808;
ERROR 22003: BIGINT value is out of range in '-9223372036854775808 + -9223372036854775808'
SELECT 9223372036854775807 + 9223372036854775807;
-ERROR 22003: BIGINT value is out of range in '9223372036854775807 + 9223372036854775807'
+9223372036854775807 + 9223372036854775807
+-2
SELECT CAST(0 AS UNSIGNED) - 9223372036854775809;
ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(0 as unsigned) - 9223372036854775809'
SELECT 9223372036854775808 - 9223372036854775809;
@@ -645,7 +646,8 @@ ERROR 22003: BIGINT UNSIGNED value is ou
SELECT -9223372036854775808 - 1;
ERROR 22003: BIGINT value is out of range in '-9223372036854775808 - 1'
SELECT 9223372036854775807 - -9223372036854775808;
-ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -9223372036854775808'
+9223372036854775807 - -9223372036854775808
+-1
set SQL_MODE='NO_UNSIGNED_SUBTRACTION';
SELECT 18446744073709551615 - 1;
ERROR 22003: BIGINT value is out of range in '18446744073709551615 - 1'
@@ -654,7 +656,8 @@ ERROR 22003: BIGINT value is out of rang
SELECT 18446744073709551614 - (-1);
ERROR 22003: BIGINT value is out of range in '18446744073709551614 - -1'
SELECT 9223372036854775807 - -1;
-ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -1'
+9223372036854775807 - -1
+-9223372036854775808
set SQL_MODE=default;
SELECT 4294967296 * 4294967296;
ERROR 22003: BIGINT value is out of range in '4294967296 * 4294967296'

72
gcc13-fix.patch Normal file
View File

@ -0,0 +1,72 @@
Index: mariadb-10.11.3/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
===================================================================
--- mariadb-10.11.3.orig/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
+++ mariadb-10.11.3/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h
@@ -5,6 +5,7 @@
#pragma once
+#include <cstdint>
#include "rocksdb/rocksdb_namespace.h"
struct CompactionIterationStats {
Index: mariadb-10.11.3/storage/rocksdb/rocksdb/env/composite_env_wrapper.h
===================================================================
--- mariadb-10.11.3.orig/storage/rocksdb/rocksdb/env/composite_env_wrapper.h
+++ mariadb-10.11.3/storage/rocksdb/rocksdb/env/composite_env_wrapper.h
@@ -5,6 +5,7 @@
#pragma once
+#include <cstdint>
#include "rocksdb/env.h"
#include "rocksdb/file_system.h"
Index: mariadb-10.11.3/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
===================================================================
--- mariadb-10.11.3.orig/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
+++ mariadb-10.11.3/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h
@@ -8,6 +8,7 @@
#pragma once
#ifndef ROCKSDB_LITE
+#include <cstdint>
#include <string>
#include <vector>
#include "rocksdb/status.h"
Index: mariadb-10.11.3/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
===================================================================
--- mariadb-10.11.3.orig/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
+++ mariadb-10.11.3/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include <cstdint>
#include "rocksdb/slice.h"
Index: mariadb-10.11.3/storage/rocksdb/rocksdb/util/string_util.h
===================================================================
--- mariadb-10.11.3.orig/storage/rocksdb/rocksdb/util/string_util.h
+++ mariadb-10.11.3/storage/rocksdb/rocksdb/util/string_util.h
@@ -10,6 +10,7 @@
#include <string>
#include <unordered_map>
#include <vector>
+#include <cstdint>
#include "rocksdb/rocksdb_namespace.h"
Index: mariadb-10.11.3/tpool/aio_linux.cc
===================================================================
--- mariadb-10.11.3.orig/tpool/aio_linux.cc
+++ mariadb-10.11.3/tpool/aio_linux.cc
@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fi
# include <cstdio>
# include <libaio.h>
# include <sys/syscall.h>
+# include <cstdio>
/**
Invoke the io_getevents() system call, without timeout parameter.

117
macros.mariadb-test Normal file
View File

@ -0,0 +1,117 @@
%__mysql_test_run_dir /tmp/mysql
%__mysql_test_user dbuser
%__mysql_test_pass dbuserpass
%__mysql_test_cconf abuild-myclient.cnf
%__mysql_test_port 63306
%__mysql_test_db testdb
#
# macro: mysql_testserver_start -- start a test mysqld instance
#
# usage: %mysql_test_start -u <db_user> -p <db_user_password> -t <port> -d <db_names>
#
# db_user: user of the database (not admin of the server)
# db_user_password: his password
# db_names: name or names separated by semicolon (e. g. testhat or test1:test2)
#
%mysql_testserver_start(u:p:t:d:) \
TEST_RUN_DIR=%{__mysql_test_run_dir} \
TEST_USER="%{-u:%{-u*}}" \
if [ -z "$TEST_USER" ]; then \
TEST_USER='%{__mysql_test_user}' \
fi \
TEST_PASS="%{-p:%{-p*}}" \
if [ -z "$TEST_PASS" ]; then \
TEST_PASS='%{__mysql_test_pass}' \
fi \
TEST_PORT="%{-t:%{-t*}}" \
if [ -z "$TEST_PORT" ]; then \
TEST_PORT='%{__mysql_test_port}' \
fi \
TEST_DB="%{-d:%{-d*}}" \
if [ -z "$TEST_DB" ]; then \
TEST_DB='%{__mysql_test_db}' \
fi \
\
[ -d $TEST_RUN_DIR ] && rm -r $TEST_RUN_DIR \
mkdir -p $TEST_RUN_DIR/datadir{,-private} \
\
cat << EOF > $TEST_RUN_DIR/my.cnf \
[client] \
socket = $TEST_RUN_DIR/mysql.sock \
port = $TEST_PORT \
[mysqld] \
user = abuild \
log-error = $TEST_RUN_DIR/mysqld.log \
secure_file_priv = $TEST_RUN_DIR/datadir-private \
datadir = $TEST_RUN_DIR/datadir \
server-id = 1 \
socket = $TEST_RUN_DIR/mysql.sock \
port = $TEST_PORT \
sql_mode = '' \
EOF\
\
echo '>>> Initializing databases' \
mysql_install_db --defaults-file=$TEST_RUN_DIR/my.cnf \
\
echo '>>> Invoking mysqld' \
/usr/sbin/mysqld --defaults-file=$TEST_RUN_DIR/my.cnf& \
sleep 2 \
\
echo ">>> Creating \'$TEST_DB\' database, (credentials: $TEST_USER, $TEST_PASS)" \
mysqladmin --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild password abuildpw \
for db in `echo $TEST_DB | tr ':' ' '`; do \
mysqladmin --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw create $db \
done \
cat << EOF > $TEST_RUN_DIR/create_auth.sql \
CREATE USER '$TEST_USER'@'localhost' IDENTIFIED BY '$TEST_PASS'; \
GRANT ALL PRIVILEGES ON * . * TO '$TEST_USER'@'localhost'; \
FLUSH PRIVILEGES; \
EOF\
mysql --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw < $TEST_RUN_DIR/create_auth.sql \
%nil
#
# macro: mysql_testserver_cconf -- generate client access conf
#
# usage: %mysql_testserver_cconf -n <filename> -d <dbname>
#
# filename: filename of the configuration
# dbname: database name (only one, not multiple as in %mysql_testserver_start)
%mysql_testserver_cconf(n:d:) \
TEST_RUN_DIR=%{__mysql_test_run_dir} \
TEST_CCONF="%{-n:%{-n*}}" \
if [ -z "$TEST_CCONF" ]; then \
TEST_CCONF='%{__mysql_test_cconf}' \
fi \
TEST_DB="%{-d:%{-d*}}" \
if [ -z "$TEST_DB" ]; then \
TEST_DB='%{__mysql_test_db}' \
fi \
cat << EOF > $TEST_CCONF \
[client] \
user = $TEST_USER \
password = $TEST_PASS \
database = $TEST_DB \
socket = $TEST_RUN_DIR/mysql.sock \
port = $TEST_PORT \
EOF\
%nil
#
# macro: mysql_testserver_stop -- start a test mysqld instance
#
# usage: %mysql_test_stop
#
%mysql_testserver_stop() \
TEST_RUN_DIR=%{__mysql_test_run_dir} \
echo '>>> Shutting the mysql server down' \
cat << EOF > $TEST_RUN_DIR/shutdown.sql \
SHUTDOWN; \
EOF\
mysql --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw < $TEST_RUN_DIR/shutdown.sql \
%nil

View File

@ -0,0 +1,19 @@
PATCH-P0-FIX-HACK: Not enforcing specific flags
Useing some CFLAGS from distribution and some enforced can and leads to the
conflicts like FORTIFY and -O0. Removing hardcoded options.
Maintainer: Michal Hrusecky <mhrusecky@suse.cz>
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -263,7 +263,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN A
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("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
ENDIF()
OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_RETURN()/DBUG_PRINT()" ON)

View File

@ -0,0 +1,26 @@
PATCH-P0-FIX-SUSE: Fix log file path for logrotate
In SUSE we've got MySQL log in different directory. It's located in
/var/log/mysql by default. It also adds some extra error message.
Maintainer: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
Index: support-files/mariadb.logrotate.sh
===================================================================
--- support-files/mariadb.logrotate.sh.orig
+++ support-files/mariadb.logrotate.sh
@@ -32,6 +32,14 @@
then
@bindir@/mariadb-admin $EXTRAPARAM --local flush-error-log \
flush-engine-log flush-general-log flush-slow-log
+ ret=$?
+ if test $ret -ne 0
+ then
+ echo "/etc/logrotate.d/mariadb failed, probably because" >&2
+ echo "the root acount is protected by password." >&2
+ echo "See comments in /etc/logrotate.d/mariadb on how to fix this" >&2
+ exit $ret
+ fi
fi
endscript
}

View File

@ -0,0 +1,37 @@
Index: mariadb-10.4.32/scripts/mysql_install_db.sh
===================================================================
--- mariadb-10.4.32.orig/scripts/mysql_install_db.sh
+++ mariadb-10.4.32/scripts/mysql_install_db.sh
@@ -494,20 +494,22 @@ 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
+ tool_ownership=`stat -c "%U:%G" "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"`
+ tool_mode=`stat -c "%a" "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"`
+
+ if test "$tool_ownership" != "root:root" -o "$tool_mode" != "4755"
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 "Permissions/ownership of the '$pamtooldir/auth_pam_tool_dir/auth_pam_tool' file are bad."
+ echo "It must be owned by root:root and have mode 4750."
echo
fi
- chown $user "$pamtooldir/auth_pam_tool_dir" && \
- chmod 0700 "$pamtooldir/auth_pam_tool_dir"
- if test $? -ne 0
+
+ dir_ownership=`stat -c "%U:%G" "$pamtooldir/auth_pam_tool_dir"`
+ dir_mode=`stat -c "%a" "$pamtooldir/auth_pam_tool_dir"`
+ if test "$dir_ownership" != "root:mysql" -o "$dir_mode" != "750"
then
- echo "Cannot change ownership of the '$pamtooldir/auth_pam_tool_dir' directory"
- echo "to the '$user' user. Check that you have the necessary permissions and try again."
+ echo "Permissions/ownership of the '$pamtooldir/auth_pam_tool_dir' directory are bad."
+ echo "It must be owned by root:mysql and have mode 0750, the PAM authentication plugin doesn't work otherwise.."
echo
fi
fi

View File

@ -0,0 +1,21 @@
SUSE specific patch that hardens the auth_pam_tool setuid-root binary.
Matthias Gerstner wants it as a prerequisite for allowing auth_pam_tool
setuid-root binary in [bsc#1160285].
Index: mariadb-10.4.12/plugin/auth_pam/auth_pam_base.c
===================================================================
--- mariadb-10.4.12.orig/plugin/auth_pam/auth_pam_base.c
+++ mariadb-10.4.12/plugin/auth_pam/auth_pam_base.c
@@ -149,6 +149,12 @@ static int pam_auth_base(struct param *p
const char *service = info->auth_string && info->auth_string[0]
? info->auth_string : "mysql";
+ if( strcmp(service, "mysql") != 0 )
+ {
+ PAM_DEBUG((stderr, "PAM: rejecting non-standard PAM service %s\n", service));
+ return CR_ERROR;
+ }
+
param->ptr = param->buf + 1;
PAM_DEBUG((stderr, "PAM: pam_start(%s, %s)\n", service, info->user_name));

3
mariadb-11.4.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c600e38adb899316c1cb11c68b87979668f4fb9d858000e347e6d8b7abe51b0
size 107373265

16
mariadb-11.4.2.tar.gz.asc Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmZV/SQACgkQ8WVvJMdM
0di3TBAAg3RLiESHGU1uT29tmVR40UMhnYgvripgWBGkoxbbOOhO92yLkL/gALqN
NTqI0lLp2qLTIsdZA8Njdvdk6DnQrRpS3C4p9LOmCAkbTSESP0d8xAopc4w9r5oC
9Juw5DmnIeHv/XjR2g1OBK3QwwlFzYJYV1RMCWtjvYloB6pN6XljKfWCHlpUq9z+
/fKQ3uZ23qoIo+xpmXYQrDIj4Z/QRd2Lc6pFpinc23qFrd+nN8pHzMo9pbg4X/jT
GEKQgqwQw4PYNdG6/ZaYy1KvHuf9+eIfRj/oNHDpSRclkEvt55v1zwt5QI2OfJzr
S+9tsW9XMJPr78EeNHLFkvLf3RP35ihFXrITYtEIkuBd4alfj6Yc7MFzvFVZ9jwE
5rlvL3/m0sKGZFoJNAnifnPpAB/ix1HgB/re7SGfJhBJxSvvUKgyz8GD0zhgFVnF
LcT12yJu01Mq1z4FwAi5hjY3cd4Wdhoq/K5zlTsXMLq3cKpb0YVc/yUA6Tl1wYqS
tDWchiC+t5yqmMHib26MSXYWYI2dnmgZc+wPqerDWBO3FGJg3NaD6pyYqUPdggZp
SefpXDfqhUkbYIejcty6042Sxmk/M1fVQiI2/r+bi3cYr4+t74u84zWv7fJUDtV9
3PRTokdWQ/+f1XOrW+6++e+yFlqUZCdY1G0oQ4O+H01jX6XArNQ=
=s19Z
-----END PGP SIGNATURE-----

25
mariadb-rpmlintrc Normal file
View File

@ -0,0 +1,25 @@
# This file contains a list of exceptions for rpmlint checker
# Zero-length
# Some test results can be zero-length files
addFilter(r'(zero-length|pem-certificate) /usr/share/mariadb-test/*')
# Permissions
# wsrep_sst_common
# It contains a parser of arguments for other sst scripts.
# It is meant to be sourced, not to be executed alone.
# So it correctly does not have shebang nor executable bit.
addFilter(r'non-executable-in-bin /usr/bin/wsrep_sst_common 644')
addFilter(r'script-without-shebang /usr/bin/wsrep_sst_common')
# Support both rpmlint 1.x and 2.x
# Wrong location
# wsrep_check_version is a wsrep version check utility. Used in testing only.
addFilter(r'arch-dependent-file-in-usr-share .* /usr/share/mariadb-test/lib/My/SafeProcess/wsrep_check_version')
addFilter(r'arch-dependent-file-in-usr-share /usr/share/mariadb-test/lib/My/SafeProcess/wsrep_check_version')
# my_safe_process is an utility that encapsulates process creation, monitoring and cleanup. Used in testing only.
addFilter(r'arch-dependent-file-in-usr-share .* /usr/share/mariadb-test/lib/My/SafeProcess/my_safe_process')
addFilter(r'arch-dependent-file-in-usr-share /usr/share/mariadb-test/lib/My/SafeProcess/my_safe_process')
# pam_mariadb_mtr.so is a pam module to test pam authentication plugin. Used in pam.test only.
addFilter(r'arch-dependent-file-in-usr-share .* /usr/share/mariadb-test/suite/plugins/pam/pam_mariadb_mtr.so')
addFilter(r'arch-dependent-file-in-usr-share /usr/share/mariadb-test/suite/plugins/pam/pam_mariadb_mtr.so')

4327
mariadb.changes Normal file

File diff suppressed because it is too large Load Diff

51
mariadb.keyring Normal file
View File

@ -0,0 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFb8EKsBEADwGmleOSVThrbCyCVUdCreMTKpmD5p5aPz/0jc66050MAb71Hv
TVcfuMqHYO8O66qXLpEdqZpuk4D+rw1oKyC+d8uPD2PSHRqBXnR0Qf+LVTZvtO92
3R7pYnC2x6V6iVGpKQYFP8cwh2B1qgIa+9y/N8cQIqfD+0ghyiUjjTYek3YFBnqa
L/2h2V0Mt0DkBrDK80LqEY10PAFDfJjINAW9XNHZzi2KqUx5w1z8rItokXV6fYE5
ItyGMR6WVajJg5D4VCiZd0ymuQP2bGkrRbl6FH5vofVSkahKMJeHs2lbvMvNyS3c
n8vxoBvbbcwSAV1gvB1uzXXxv0kdkFZjhU1Tss4+Dak8qeEmIrC5qYycLxIdVEhT
Z8N8+P7Dll+QGOZKu9+OzhQ+byzpLFhUHKys53eXo/HrfWtw3DdP21yyb5P3QcgF
scxfZHzZtFNUL6XaVnauZM2lqquUW+lMNdKKGCBJ6co4QxjocsxfISyarcFj6ZR0
5Hf6VU3Y7AyuFZdL0SQWPv9BSu/swBOimrSiiVHbtE49Nx1x/d1wn1peYl07WRUv
C10eF36ZoqEuSGmDz59mWlwB3daIYAsAAiBwgcmN7aSB8XD4ZPUVSEZvwSm/IwuS
Rkpde+kIhTLjyv5bRGqU2P/Mi56dB4VFmMJaF26CiRXatxhXOAIAF9dXCwARAQAB
tC1NYXJpYURCIFNpZ25pbmcgS2V5IDxzaWduaW5nLWtleUBtYXJpYWRiLm9yZz6J
AjgEEwEIACIFAlb8EKsCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEPFl
byTHTNHYJZ0P/2Z2RURRkSTHLKZ/GqSvPReReeB7AI+ZrDapkpG/26xp1Yw1isCO
y99pvQ7hjTFhdZQ7xSRUiT/e27wJxR7s4G/ck5VOVjuJzGnByNLmwMjdN1ONIO9P
hQAs2iF3uoIbVTxzXof2F8C0WSbKgEWbtqlCWlaapDpN8jKAWdsQsNMdXcdpJ2os
WiacQRxLREBGjVRkAiqdjYkegQ4BZ0GtPULKjZWCUNkaat51b7O7V19nSy/T7MM7
n+kqYQLMIHCF8LGd3QQsNppRnolWVRzXMdtR2+9iI21qv6gtHcMiAg6QcKA7halL
kCdIS2nWR8g7nZeZjq5XhckeNGrGX/3w/m/lwczYjMUer+qs2ww5expZJ7qhtSta
lE3EtL/l7zE4RlknqwDZ0IXtxCNPu2UovCzZmdZm8UWfMSKk/3VgL8HgzYRr8fo0
yj0XkckJ7snXvuhoviW2tjm46PyHPWRKgW4iEzUrB+hiXpy3ikt4rLRg/iMqKjyf
mvcE/VdmFVtsfbfRVvlaWiIWCndRTVBkAaTu8DwrGyugQsbjEcK+4E25/SaKIJIw
qfxpyBVhru21ypgEMAw1Y8KC7KntB7jzpFotE4wpv1jZKUZuy71ofr7g3/2O+7nW
LrR1mncbuT6yXo316r56dfKzOxQJBnYFwTjXfa65yBArjQBUCPNYOKr0uQINBFb8
EKsBEADDfCMsu2U1CdJhr4xp6z4J89/tMnpCQASC8DQhtZ6bWG/ksyKt2DnDQ050
XBEng+7epzHWA2UgT0liY05zZmFs1X7QeZr16B7JANq6fnHOdZB0ThS7JEYbProk
MxcqAFLAZJCpZT534GpzW7qHwzjV+d13IziCHdi6+DD5eavYzBqY8QzjlOXbmIlY
7dJUCwXTECUfirc6kH86CS8fXZTke4QYZ55VnrOomB4QGqP371kwBETnhlhi74+p
vi3jW05Z5x1tVMwuugyzzkseZp1VYmJq5SHNFZ/pnAQLE9gUDTb6UWcPBwQh9Sw+
7ahSK74lJKYm3wktyvZhzAxbNyzs1M56yeFP6uFwJTBfNByyMAa6TGUhNkxlLcYj
xKbVmoAnKCVM8t41TlLv/a0ki8iQxqvphVLufksR9IpN6d3F15j6GeyVtxBEv04i
v4vbuKthWytb+gjX4bI8CAo9jGHevmtdiw/SbeKx2YBM1MF6eua37rFMooOBj4X7
VfQCyS+crNsOQn8nJGahYbzUDCCgnX+pqN9iZvXisMS79wVyD5DyISFDvT/5jY7I
XxPibxr10P/8lfW1d72uxyI2UiZKZpyHCt4k47yMq4KQGLGuhxJ6q6O3bi2aXRuz
8bLqTBLca9dmx9wZFvRh6jS/SKEg7eFcY0xbb6RVIv1UwGDYfQARAQABiQIfBBgB
CAAJBQJW/BCrAhsMAAoJEPFlbyTHTNHYEBIQAJhFTh1u34Q+5bnfiM2dAdCr6T6w
4Y1v9ePiIYdSImeseJS2yRglpLcMjW0uEA9KXiRtC/Nm/ClnqYJzCKeIaweHqH6d
IgJKaXZFt1Uaia7X9tDDwqALGu97irUrrV1Kh9IkM0J29Vid5amakrdS4mwt2uEI
SSnCi7pfVoEro+S7tYQ9iH6APVIwqWvcaty3cANdwKWfUQZ6a9IQ08xqzaMhMp2V
zhVrWkq3B0j2aRoZR7BNLH2I7Z0giIM8ARjZs99aTRL+SfMEQ3sUxNLb3KWP/n1l
SFbrk4HGzqUBBfczESlNc0970C6znK0H0HD11/3BTkMuPqww+Tzex4dpMQllMEKZ
3wEyd9v6ba+nj/P1FHSEy/VN6IXzd82s1lYOonKTdmXAIROcHnb0QUzwsd/mhB3j
KhEDOV2ZcBTD3yHv8m7C9G9y4hV+7yQlnPlSg3DjBp3SS5r+sOObCIy2Ad32upoX
kilWa9g7GZSuhY9kyKqeEba1lgXXaQykEeqx0pexkWavNnb9JaPrAZHDjUGcXrRE
mjEyXyElRoD4CrWXySe46jCuNhVVlkLGo7osefynXa/+PNjQjURtx8en7M9A1FkQ
uRAxE8KIZgZzYxkGl5o5POSFCA4JUoRPDcrl/sI3fuq2dIOE/BJ2r8dV+LddiR+i
ukhXRwJXH8RVVEUS
=ihRo
-----END PGP PUBLIC KEY BLOCK-----

71
mariadb.service.in Normal file
View File

@ -0,0 +1,71 @@
# It's not recommended to modify this unit file because your changes
# would be overwritten during the package update.
#
# However, there are 2 methods how to customize this unit file:
#
# 1) Copy this unit file from /usr/lib/systemd/system to
# /etc/systemd/system and modify the chosen settings.
#
# 2) Create a directory named mariadb.service.d/ within /etc/systemd/system
# and place a drop-in file name.conf there that only changes the specific
# settings one is interested in.
#
# see systemd.unit(5) for details
#
# Example - increasing of the TimeoutSec= limit
# mkdir /etc/systemd/system/mariadb.service.d
# cat > /etc/systemd/system/mariadb.service.d/timeout.conf << EOF
# [Service]
# TimeoutSec=600
# EOF
[Unit]
Description=MariaDB database server
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
Conflicts=mariadb.target
After=network.target time-sync.target
[Install]
WantedBy=multi-user.target
Alias=mysql.service
[Service]
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper install
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper upgrade
ExecStart=@LIBEXECDIR@/mysql/mysql-systemd-helper start
Type=notify
User=mysql
Group=mysql
KillSignal=SIGTERM
# Don't want to see an automated SIGKILL ever
SendSIGKILL=no
# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s
# Configures the time to wait for start-up/stop
TimeoutSec=300
# CAP_IPC_LOCK To allow memlock to be used as non-root user
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0
# does nothing for non-root, not needed if /etc/shadow is u+r
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason
CapabilityBoundingSet=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE
# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full
# Prevent accessing /home, /root and /run/user
ProtectHome=true
# Execute pre and post scripts as root, otherwise it does it as User=
PermissionsStartOnly=true
UMask=007

949
mariadb.spec Normal file
View File

@ -0,0 +1,949 @@
#
# spec file for package mariadb
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# libmariadbd soname (embedded library)
%define soname 19
# Set this to 1 to run regression test suite (it takes a long time)
%define run_testsuite 1
# Set this to 1 for testing purposes (run all regression tests but ignore
# failures). Set this to 0 for production usage (skip tests in the
# unstable-tests list (contains also suse_skipped_tests.list) and don't
# ignore failures
%define ignore_testsuite_result 0
%define with_oqgraph 1
# Mroonga and RocksDB are available only for x86_64 architecture
# see https://mariadb.com/kb/en/mariadb/about-mroonga/ and
# https://mariadb.com/kb/en/library/myrocks-supported-platforms/
%ifarch x86_64
%define with_mroonga 1
%define with_rocksdb 1
%else
%define with_mroonga 0
%define with_rocksdb 0
%endif
# Build galera on SLE. Galera requires mariadb >= 10.5, so only
# build it on SLE15SP3 onwards
%if 0%{?is_opensuse} || 0%{?sle_version} >= 150300
%bcond_without galera
%else
%bcond_with galera
%endif
# Define python interpreter version
%if 0%{?suse_version} >= 1500
%define python_path %{_bindir}/python3
%else
%define python_path %{_bindir}/python2
%endif
# Build with cracklib plugin when cracklib-dict-full >= 2.9.0 is available
%define with_cracklib_plugin 0
Name: mariadb
Version: 11.4.2
Release: 0
Summary: Server part of MariaDB
License: SUSE-GPL-2.0-with-FLOSS-exception
Group: Productivity/Databases/Servers
URL: https://www.mariadb.org
Source: https://downloads.mariadb.com/MariaDB/%{name}-%{version}/source/%{name}-%{version}.tar.gz
Source1: https://downloads.mariadb.com/MariaDB/%{name}-%{version}/source/%{name}-%{version}.tar.gz.asc
Source2: %{name}.keyring
Source4: README.debug
Source5: suse-test-run
Source7: README.install
Source12: mysql-user.conf
Source14: my.ini
Source15: mariadb.service.in
Source16: mariadb.target
Source17: mysql-systemd-helper
Source18: mariadb@.service.in
Source19: macros.mariadb-test
Source50: suse_skipped_tests.list
Source51: mariadb-rpmlintrc
Source52: series
Patch1: mariadb-10.2.4-logrotate.patch
Patch4: mariadb-10.2.4-fortify-and-O.patch
Patch6: mariadb-10.4.12-harden_setuid.patch
Patch7: mariadb-10.4.12-fix-install-db.patch
Patch10: fix-pamdir.patch
Patch11: gcc13-fix.patch
# needed for bison SQL parser and wsrep API
BuildRequires: bison
BuildRequires: cmake
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: gcc-c++
# GSSAPI
BuildRequires: krb5-devel
# embedded server libmariadbd
BuildRequires: libaio-devel
# mariabackup tool
BuildRequires: libarchive-devel
BuildRequires: libbz2-devel
# commands history feature
BuildRequires: libedit-devel
BuildRequires: libevent-devel
BuildRequires: liblz4-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
# CLI graphic and wsrep API
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
# auth_pam.so plugin
BuildRequires: pam-devel
# MariaDB requires a specific version of pcre. Provide MariaDB with
# "BuildRequires: pcre-devel" and it automatically decides if the version is
# ok or not. If not, it uses bundled pcre.
BuildRequires: pcre2-devel
BuildRequires: pkgconfig
BuildRequires: procps
# Some tests and myrocks_hotbackup script need python3
BuildRequires: python3
BuildRequires: sqlite
BuildRequires: sysuser-tools
BuildRequires: tcpd-devel
# Tests requires time and ps and some perl modules
# Keep in sync with Requires of mysql-testsuite
BuildRequires: time
BuildRequires: unixODBC-devel
BuildRequires: zlib-devel
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Env)
BuildRequires: perl(Exporter)
BuildRequires: perl(Fcntl)
BuildRequires: perl(File::Temp)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IPC::Open3)
BuildRequires: perl(Memoize)
BuildRequires: perl(Socket)
BuildRequires: perl(Symbol)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(Test::More)
BuildRequires: perl(Time::HiRes)
# Do not ever switch away from BuildRequires: pkgconfig(libsystemd); BuildRequires systemd/systemd-devel causes build cycles
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(fmt) < 10
#!BuildIgnore: user(mysql)
# Required by rcmysql
Requires: %{name}-client
Requires: %{name}-errormessages = %{version}
# Requires /bin/hostname because otherwise we have a conflict on Leap (bsc#1009905).
# It can be switched back to plain "hostname" when this bug is resolved
Requires: /bin/hostname
Requires: perl-base
# myrocks_hotbackup needs MySQLdb - if we want to use it under python3, we need python3-mysqlclient
Requires: python3-mysqlclient
Requires: user(mysql)
Requires(post): permissions
# Require mysql user
Requires(pre): user(mysql)
Recommends: logrotate
Conflicts: mariadb-server
Conflicts: mysql
Conflicts: mysql-debug
Conflicts: mysql-server
# Compatibility with Fedora/CentOS
Provides: mariadb-server = %{version}
Provides: mysql-server = %{version}
# Compatibility with old version
Provides: %{name}-debug-version = %{version}
Obsoletes: %{name}-debug-version < %{version}
Provides: %{name}-debug = %{version}
Obsoletes: %{name}-debug < %{version}
Provides: mysql = %{version}
Obsoletes: mysql < %{version}
Provides: mysql-debug = %{version}
Obsoletes: mysql-debug < %{version}
%if 0%{?suse_version} < 1500
# Explicit requires of systemd is not needed anymore and
# creates a problem for containers
%{?systemd_requires}
%endif
# Do not BuildRequires lzo for i586 and arm
# https://lists.launchpad.net/maria-discuss/msg04639.html
%ifnarch i586 %{arm}
BuildRequires: lzo-devel
%endif
# boost and Judy are required for oograph
%if 0%{with_oqgraph} > 0
BuildRequires: judy-devel
%if 0%{?suse_version} > 1315
BuildRequires: libboost_headers-devel
%else
BuildRequires: boost-devel
%endif
%endif
%description
MariaDB is an open-source, multi-threaded, relational database management
system. It's a backward compatible, drop-in replacement branch of the
MySQL Community Server.
This package only contains the server-side programs.
%package -n libmariadbd%{soname}
Summary: MariaDB embedded server library
Group: System/Libraries
Requires: %{name}-errormessages >= %{version}
Provides: libmysqld = %{version}-%{release}
Obsoletes: libmysqld < %{version}-%{release}
%description -n libmariadbd%{soname}
This package contains MariaDB library that allows to run an embedded
MariaDB server inside a client application.
%package -n libmariadbd-devel
Summary: MariaDB embedded server development files
Group: Development/Libraries/C and C++
Requires: libaio-devel
# The headers files are the shared
Requires: libmariadb-devel >= 3.0
Requires: libmariadbd%{soname} = %{version}
Requires: tcpd-devel
Provides: libmysqld-devel = %{version}-%{release}
Obsoletes: libmysqld-devel < %{version}-%{release}
%description -n libmariadbd-devel
This package contains the development header files and libraries
for developing applications that embed the MariaDB.
%package rpm-macros
Summary: MariaDB RPM macros
Requires: %{name}
%description rpm-macros
Provides macros usable in rpm spec files.
%package client
Summary: Client for MariaDB
Group: Productivity/Databases/Clients
Requires: %{name}-errormessages = %{version}
# Explicit requires to pull in charsets for errormessages
Requires: libmariadb3 >= 3.0
Conflicts: mysql-client
Provides: mysql-client = %{version}
Obsoletes: mysql-client < %{version}
%sysusers_requires
%description client
This package contains the standard clients for MariaDB.
%if %{with galera}
%package galera
Summary: The configuration files and scripts for galera replication
Group: Productivity/Databases/Tools
Requires: %{name} = %{version}
Requires: galera-4
Requires: iproute2
Requires: lsof
Requires: rsync
Requires: socat
Requires: which
%description galera
This package contains configuration files and scripts that are
needed for running MariaDB Galera Cluster.
%endif
%package errormessages
Summary: The error messages files required by server, client and libmariadbd
Group: System/Localization
BuildArch: noarch
%description errormessages
This package provides translated error messages for the standalone
server daemon, embedded server and client.
%package bench
Summary: Benchmarks for MariaDB
Group: Productivity/Databases/Tools
Requires: %{name}-client
Requires: perl-DBD-mysql
Conflicts: mysql-bench
Provides: mysql-bench = %{version}
Obsoletes: mysql-bench < %{version}
%description bench
This package contains benchmark scripts and data for MariaDB.
To run these database benchmarks, start the script "run-all-tests" in
the directory %{_datadir}/sql-bench after starting MariaDB.
%package test
Summary: Testsuite for MariaDB
Group: Productivity/Databases/Servers
Requires: %{name} = %{version}
Requires: %{name}-bench = %{version}
Requires: %{name}-client = %{version}
Requires: %{name}-tools = %{version}
# Requires libmariadb_plugins in order to test client plugins successfuly
Requires: libmariadb_plugins >= 3.0
Requires: perl-DBD-mysql
Requires: procps
Requires: time
# Tests requires time and ps and some perl modules
Requires: perl(Data::Dumper)
Requires: perl(Env)
Requires: perl(Exporter)
Requires: perl(Fcntl)
Requires: perl(File::Temp)
Requires: perl(Getopt::Long)
Requires: perl(IPC::Open3)
Requires: perl(Memoize)
Requires: perl(Socket)
Requires: perl(Symbol)
Requires: perl(Sys::Hostname)
Requires: perl(Test::More)
Requires: perl(Time::HiRes)
Conflicts: mysql-test
Provides: mysql-test = %{version}
Obsoletes: mysql-test < %{version}
%description test
This package contains the test scripts and data for MariaDB.
To run the testsuite, run %{_datadir}/%{name}-test/suse-test-run.
%package tools
Summary: MariaDB tools
Group: Productivity/Databases/Servers
Requires: perl-DBD-mysql
Conflicts: mysql-tools
# make sure this package is installed when updating from 10.2 and older
Provides: mysql-client:%{_bindir}/perror
Provides: mysql-tools = %{version}
Provides: mysql:%{_bindir}/mysqlhotcopy
Obsoletes: mysql-tools < %{version}
%description tools
A set of scripts for administering a MariaDB or developing
applications with MariaDB.
%if 0%{with_cracklib_plugin} > 0
%package cracklib-password-check
Summary: The password strength checking plugin
BuildRequires: cracklib-devel >= 2.9.0
BuildRequires: cracklib-dict-small >= 2.9.0
Requires: %{name} = %{version}
Requires: cracklib-dict-small >= 2.9.0
%description cracklib-password-check
cracklib_password_check is a password validation plugin. It uses the CrackLib
library to check the strength of new passwords. CrackLib is installed by default
in many Linux distributions, since the system's PAM authentication framework is
usually configured to check the strength of new passwords with the pam_cracklib
PAM module.
%endif
%prep
%setup -q
# Remove JAR files from the tarball (used for testing from the source)
find . -name "*.jar" -type f -exec rm --verbose -f {} \;
%patch -P 1
%patch -P 4
%patch -P 6 -p1
%patch -P 7 -p1
# usrmerge has only been applied to TW
%if 0%{?suse_version} > 1500
%patch -P 10 -p1
%endif
%patch -P 11 -p1
cp %{_sourcedir}/suse-test-run .
# Remove unneeded manpages ('make install' basically installs everything under
# man/*)
rm -f man/mysqlman.1 # dummy fallback manpage
[ \! -f man/CMakeLists.txt ] || sed -i 's|mysqlman.1||' man/CMakeLists.txt
rm -f man/mysql.server.1 # init script, not installed in our rpm
[ \! -f man/CMakeLists.txt ] || sed -i 's|mysql.server.1||' man/CMakeLists.txt
rm -f man/make_win_*.1 # windows build scripts
rm -f man/comp_err.1 # built-time utility
# Breaks VPATH builds when in sourcedir, is generated in the builddirs
rm -f sql/sql_builtin.cc
# Broken test that needs sources
rm -f %{name}-test/t/file_contents.test %{name}-test/r/file_contents.result
# Specify perl path on shebangs
for i in `grep -Rl '^#!%{_bindir}/env perl$' .`; do
sed -i 's|%{_bindir}/env perl|%{_bindir}/perl|' $i
done
# Add our list of tests that fail (correctly or temporarily) to the list of such
# tests created by upstream
cat %{SOURCE50} | tee -a mysql-test/unstable-tests
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
EXTRA_FLAGS="-Wno-unused-but-set-variable -fno-strict-aliasing -Wno-unused-parameter"
# Mariadb devs seems to fall in love with -Werror option
EXTRA_FLAGS="${EXTRA_FLAGS} -Wno-error"
export CFLAGS="%{optflags} -DOPENSSL_LOAD_CONF -DPIC -fPIC -DFORCE_INIT_OF_VARS $EXTRA_FLAGS"
export CXXFLAGS="$CFLAGS -felide-constructors"
%cmake -DWITH_SSL=system \
-DWITH_LIBWRAP=ON \
-DENABLED_PROFILING=ON \
-DENABLE_DEBUG_SYNC=OFF \
-DWITH_PIC=ON \
-DWITH_ZLIB=system \
-DWITH_LIBEVENT=system \
-DWITH_JEMALLOC=no \
-DWITH_READLINE=0 \
-DWITH_LIBEDIT=0 \
-DWITH_EDITLINE=system \
-DINSTALL_LAYOUT=RPM \
-DWITH_LZ4=system \
-DMYSQL_UNIX_ADDR="%{_rundir}/mysql/mysql.sock" \
-DINSTALL_UNIX_ADDRDIR="%{_rundir}/mysql/mysql.sock" \
-DINSTALL_MYSQLSHAREDIR=share/%{name} \
-DWITH_COMMENT="MariaDB rpm" \
-DWITH_EXTRA_CHARSET=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_unicode_520_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
%if 0%{with_oqgraph} < 1
-DPLUGIN_OQGRAPH=NO \
%endif
%if 0%{with_mroonga} < 1
-DPLUGIN_MROONGA=NO \
%endif
%if 0%{with_rocksdb} < 1
-DPLUGIN_ROCKSDB=NO \
%endif
-DPYTHON_SHEBANG=%{python_path} \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_CSV_STORAGE_ENGINE=1 \
-DWITH_HANDLERSOCKET_STORAGE_ENGINE=1 \
-DWITH_INNODB_MEMCACHED=ON \
-DWITH_EMBEDDED_SERVER=true \
%if %{with galera}
-DWITH_WSREP=ON \
-DWITH_INNODB_DISALLOW_WRITES=1 \
%endif
-DWITH_LIBARCHIVE=ON \
-DWITH_MARIABACKUP=ON \
-DCOMPILATION_COMMENT="MariaDB package" \
-DDENABLE_DOWNLOADS=false \
-DINSTALL_PLUGINDIR_RPM="%{_lib}/mysql/plugin" \
-DINSTALL_LIBDIR_RPM="%{_lib}" \
-DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="$CFLAGS" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$CXXFLAGS" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DINSTALL_SQLBENCHDIR=share \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now -Wl,-Bsymbolic -Wl,-Bsymbolic-functions" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now -Wl,-Bsymbolic -Wl,-Bsymbolic-functions" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now -Wl,-Bsymbolic -Wl,-Bsymbolic-functions" \
-DCMAKE_SKIP_RPATH=OFF \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-Wno-dev "$@" ..
%make_build
nm --numeric-sort sql/mysqld > sql/mysqld.sym
cd ..
%sysusers_generate_pre %{SOURCE12} mysql mysql-user.conf
%install
# Helper function to generate filelist for binaries and their manpages
filelist()
{
echo '%%defattr(-, root, root)'
pushd %{buildroot} >/dev/null
for i; do
if test -e usr/sbin/"$i"; then
echo %{_sbindir}/"$i"
fi
if test -e usr/bin/"$i"; then
echo %{_bindir}/"$i"
fi
if test -d usr/share/*/"$i"; then
echo "/`echo usr/share/*/"$i"`"
fi
if test -n "`ls -1 %{buildroot}$i 2> /dev/null`"; then
echo "$i"
fi
if ls usr/share/man/*/"$i".[1-9]* >/dev/null 2>&1; then
echo "%{_mandir}/*/$i.[1-9]*"
fi
done
popd >/dev/null
}
filelist_excludes()
{
echo '%%defattr(-, root, root)'
pushd %{buildroot} >/dev/null
for i; do
if test -e usr/sbin/"$i"; then
echo "%exclude %{_sbindir}/$i"
fi
if test -e usr/bin/"$i"; then
echo "%exclude %{_bindir}/$i"
fi
if test -d usr/share/*/"$i"; then
echo "%exclude /$(echo usr/share/*/"$i")"
fi
if test -n "$(ls -1 %{buildroot}$i 2> /dev/null)"; then
echo "%exclude $i"
fi
if ls usr/share/man/*/"$i".[1-9]* >/dev/null 2>&1; then
echo "%exclude %{_mandir}/*/$i.[1-9]*"
fi
done
popd >/dev/null
}
# Install the package itself
%cmake_install benchdir_root=%{_datadir}/
# Create log directory with the expected perms of mysql
install -d -m 700 %{buildroot}%{_localstatedir}/log/mysql/
# Symbols from build to go into libdir
install -m 644 build/sql/mysqld.sym %{buildroot}%{_libdir}/mysql/mysqld.sym
# INFO_SRC binary
install -p -m 644 build/Docs/INFO_SRC %{buildroot}%{_libdir}/mysql/
# Remove static libs (FIXME: don't build them at all...)
rm %{buildroot}%{_libdir}/*.a
# Remove unused stuff
rm -f %{buildroot}%{_datadir}/mysql/{errmsg-utf8.txt,mysql-log-rotate}
rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini
# binary-configure creates the MySQL system tables and starts the server (not used)
rm -f %{buildroot}%{_datadir}/%{name}/binary-configure
# FS files first-bytes recoginiton (not updated by upstream since nobody realy use that)
rm -f %{buildroot}%{_datadir}/%{name}/magic
# Upstream ships them because of MDEV-10797 (we don't need them as we use our own systemd scripts)
rm -f %{buildroot}%{_datadir}/%{name}/mysql.server
rm -f %{buildroot}%{_datadir}/%{name}/mysqld_multi.server
# upstream installs links for mysql
unlink %{buildroot}%{_datadir}/%{name}/systemd/mysql.service
unlink %{buildroot}%{_datadir}/%{name}/systemd/mysqld.service
unlink %{buildroot}%{_unitdir}/mysqld.service
# The old fork of mytop utility (we ship it as a separate package)
rm -f %{buildroot}%{_bindir}/mytop
# xtrabackup is not supported for MariaDB >= 10.3
rm -f %{buildroot}%{_bindir}/wsrep_sst_xtrabackup-v2
rm -f %{buildroot}%{_bindir}/wsrep_sst_xtrabackup
# Remove unused upstream services
rm -f %{buildroot}'%{_unitdir}/mariadb.service'
rm -f %{buildroot}'%{_unitdir}/mariadb@.service'
rm -f %{buildroot}'%{_unitdir}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf'
# Remove systemd-sysusers conf file for creating of mysql user (we do it in the specfile)
rm -f %{buildroot}%{_sysusersdir}/mariadb.conf
# Remove client libraries that are now provided in mariadb-connector-c
# Client library and links
rm %{buildroot}%{_libdir}/libmariadb.so.*
unlink %{buildroot}%{_libdir}/libmysqlclient.so
unlink %{buildroot}%{_libdir}/libmysqlclient_r.so
unlink %{buildroot}%{_libdir}/libmariadb.so
# Client plugins
rm %{buildroot}%{_libdir}/mysql/plugin/{auth_gssapi_client.so,dialog.so,mysql_clear_password.so,sha256_password.so,caching_sha2_password.so,client_ed25519.so}
# Devel files
rm %{buildroot}%{_bindir}/mysql_config
rm %{buildroot}%{_bindir}/mariadb_config
rm %{buildroot}%{_bindir}/mariadb-config
rm %{buildroot}%{_libdir}/pkgconfig/mariadb.pc
rm -f %{buildroot}%{_prefix}/lib/pkgconfig/libmariadb.pc
rm -f %{buildroot}%{_libdir}/pkgconfig/libmariadb.pc
rm %{buildroot}%{_datadir}/aclocal/mysql.m4
rm %{buildroot}%{_mandir}/man1/mariadb_config*.1*
rm %{buildroot}%{_mandir}/man1/mysql_config*.1*
rm %{buildroot}%{_mandir}/man1/mytop.1*
rm -r %{buildroot}%{_includedir}/mysql
# Devel man pages
rm -rf %{buildroot}%{_mandir}/man3/*
# Rename the wsrep README so it corresponds with the other README names
cp Docs/README-wsrep Docs/README.wsrep
# Generate various filelists (binaries and manpages)
# mariadb.files
filelist mariabackup mariadb-backup mbstream innochecksum mariadb-service-convert my_print_defaults myisam_ftdump myisamchk myisamlog myisampack mysql_fix_extensions mariadb-fix-extensions mysql_install_db mariadb-install-db mysql_secure_installation mariadb-secure-installation mysql_upgrade mariadb-upgrade mysqld mariadbd mysqld_multi mariadbd-multi mysqld_safe mariadbd-safe mysqlbinlog mariadb-binlog mysqldumpslow mariadb-dumpslow resolve_stack_dump resolveip {m,}aria_chk {m,}aria_dump_log {m,}aria_ftdump {m,}aria_pack {m,}aria_read_log tokuft_logprint tokuft_logdump tokuftdump mysql_ldb mariadb-ldb sst_dump myrocks_hotbackup >mariadb.files
# mariadb-client.files
filelist mysql mariadb mysqladmin mariadb-admin mysqlcheck mariadb-check mysqldump mariadb-dump mysqlimport mariadb-import mysqlshow mariadb-show mysql_config_editor mysqld_safe_helper mariadbd-safe-helper >mariadb-client.files
# Mysql has configuration file in _bindir
if [ -f scripts/mysqlaccess.conf ] ; then
install -m 640 scripts/mysqlaccess.conf %{buildroot}%{_sysconfdir}/mysqlaccess.conf
rm -f %{buildroot}%{_bindir}/mysqlaccess.conf
echo '%config(noreplace) %attr(0640, root, mysql) %{_sysconfdir}/mysqlaccess.conf' >> mariadb-client.files
fi
%if %{with galera}
# mariadb-galera.files
filelist galera_new_cluster galera_recovery wsrep_sst_common wsrep_sst_mariabackup wsrep_sst_mysqldump wsrep_sst_rsync wsrep_sst_rsync_wan wsrep_sst_backup >mariadb-galera.files
touch mariadb-galera-exclude.files
%else
filelist_excludes galera_new_cluster galera_recovery wsrep_sst_common wsrep_sst_mariabackup wsrep_sst_mysqldump wsrep_sst_rsync wsrep_sst_rsync_wan wsrep_sst_backup >mariadb-galera-exclude.files
echo "%exclude %{_datadir}/mysql/systemd/use_galera_new_cluster.conf" >>mariadb-galera-exclude.files
echo "%exclude %{_datadir}/mysql/wsrep_notify" >>mariadb-galera-exclude.files
%endif
# mariadb-bench.files
filelist mysqlslap mariadb-slap >mariadb-bench.files
# mariadb-test.files
filelist mysql_client_test mariadb-client-test mysql_client_test_embedded mariadb-client-test-embedded mysql_waitpid mariadb-waitpid mysqltest mariadb-test mysqltest_embedded mariadb-test-embedded >mariadb-test.files
# mariadb-tools.files
filelist msql2mysql mysql_plugin mariadb-plugin mysql_convert_table_format mariadb-convert-table-format mysql_find_rows mariadb-find-rows mysql_setpermission mariadb-setpermission mysql_tzinfo_to_sql mariadb-tzinfo-to-sql mysqlaccess mariadb-access mysqlhotcopy mariadb-hotcopy perror replace mysql_embedded mariadb-embedded aria_s3_copy mariadb-conv >mariadb-tools.files
# All configuration files
echo '%{_datadir}/%{name}/*.cnf' >> mariadb.files
# Special errormessages approach
echo '%%defattr(-, root, root)' > %{_builddir}/errormessages.files
pushd %{buildroot} >/dev/null
for f in usr/share/%{name}/*; do
if test -e $f/errmsg.sys; then
echo "%%dir /$f" >> %{_builddir}/errormessages.files
fi
done
popd >/dev/null
mv %{_builddir}/errormessages.files mariadb-errormessages.files
# Files not installed by make install
# Some of the documentation we need to have installed
DOCS=(COPYING README.md EXCEPTIONS-CLIENT %{_sourcedir}/README.debug plugin/daemon_example/daemon_example.ini)
DOCDIR=%{buildroot}%{_defaultdocdir}/%{name}
install -d -m 755 ${DOCDIR}
for i in "${DOCS[@]}"; do
install -m 644 "${i}" "${DOCDIR}" || true
done
# Install default configuration file
install -m 644 %{SOURCE14} %{buildroot}%{_sysconfdir}/my.cnf
# Systemd/initscript
install -D -m 755 %{_sourcedir}/mysql-systemd-helper '%{buildroot}'%{_libexecdir}/mysql/mysql-systemd-helper
sed -i 's|@MYSQLVER@|%{version}|' '%{buildroot}'%{_libexecdir}/mysql/mysql-systemd-helper
ln -sf service '%{buildroot}'%{_sbindir}/rcmysql
ln -sf service '%{buildroot}'%{_sbindir}/rcmariadb
rm -rf '%{buildroot}'%{_sysconfdir}/init.d
sed "s|@LIBEXECDIR@|%{_libexecdir}|g" %{_sourcedir}/mariadb.service.in > '%{buildroot}'%{_unitdir}/mariadb.service
sed "s|@LIBEXECDIR@|%{_libexecdir}|g" %{_sourcedir}/mariadb@.service.in > '%{buildroot}'%{_unitdir}/mariadb@.service
install -D -m 644 %{_sourcedir}/mariadb.target '%{buildroot}'%{_unitdir}/mariadb.target
# Aliases for the backward compatibility. Create symlinks from the alias to the existing one
# We can't use 'Alias=' option only because it's effective only when the unit is enabled
ln -sf %{_unitdir}/mariadb.service %{buildroot}%{_unitdir}/mysql.service
ln -sf %{_unitdir}/mariadb@.service %{buildroot}%{_unitdir}/mysql@.service
# Replace the default socket for multi instance mariadb with the one used by
# mysql-systemd-helper
sed -e 's:mysql.sock-%I:mysql.%I.sock:' -i %{buildroot}%{_unitdir}/mariadb@.socket
# Tmpfiles file to exclude mysql tempfiles that are auto-cleaned up
# bnc#852451
mkdir -p %{buildroot}%{_tmpfilesdir}
cat >> %{buildroot}%{_tmpfilesdir}/mariadb.conf <<EOF
x %{_localstatedir}/tmp/mysql.*
EOF
# Testsuite
install -d -m 755 '%{buildroot}'%{_datadir}/%{name}-test/
install -m 755 suse-test-run '%{buildroot}'%{_datadir}/%{name}-test/
mkdir '%{buildroot}'%{_datadir}/%{name}-test%{_localstatedir}
# Install the list of skipped tests to be available for user runs
install -p -m 0644 mysql-test/unstable-tests %{buildroot}%{_datadir}/%{name}-test
ln -s unstable-tests %{buildroot}%{_datadir}/%{name}-test/suse_skipped_tests.list
# Final fixes
find '%{buildroot}'%{_datadir}/%{name}-test -name '*.orig' -delete
%fdupes -s '%{buildroot}'%{_datadir}/%{name}-test
fdupes -q -n -r '%{buildroot}'%{_datadir}/%{name}-test
for i in `grep -Rl '\r' '%{buildroot}'%{_datadir}/sql-bench`; do
dos2unix "$i"
done
# Compat with old scripts
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqlrepair
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqlanalyze
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqloptimize
# Use our configuration stuff instead of upstream one
rm -rf '%{buildroot}'%{_sysconfdir}/my.cnf.d
install -d -m 755 '%{buildroot}'%{_sysconfdir}/my.cnf.d
%if %{with galera}
# Install galera config file and script
install -p -m 644 build/support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/50-galera.cnf
install -p -m 755 build/scripts/galera_new_cluster %{buildroot}%{_bindir}/galera_new_cluster
%endif
# Documentation that was copied to wrong folder
rm -f '%{buildroot}'%{_datadir}/doc/* 2> /dev/null || true
# Unwanted packaged stuff
rm -rf '%{buildroot}'%{_datadir}/mysql/{solaris,SELinux}
# Create the directory specified in 'secure-file-priv' option
mkdir -p '%{buildroot}'%{_localstatedir}/lib/mysql-files
# install rpm macros file
mkdir -p %{buildroot}%{_rpmmacrodir}
install -m 644 %{SOURCE19} %{buildroot}%{_rpmmacrodir}
# Install sysusers.d file
mkdir -p %{buildroot}%{_sysusersdir}
install -m 644 %{SOURCE12} %{buildroot}%{_sysusersdir}/
%check
cd build
# Run an extensive mysql test suite
# If ignore_testsuite_result == 1 then run all tests but ignore failures
# If ignore_testsuite_result == 0 then skip tests listed in unstable-tests
# (contains suse_skipped_tests.list) and don't ignore failures
%if 0%{run_testsuite} > 0
cd mysql-test
# spider test have been enabled in 10.6 and they fail, skip these tests
# mariadb-client cannot connect to the server due to self-signed certificates
./mysql-test-run.pl \
--parallel=%{?jobs:%{jobs}} \
--force \
--retry=3 \
--ssl \
--suite-timeout=900 \
--testcase-timeout=30 \
--mysqld=--binlog-format=mixed \
--force-restart \
--shutdown-timeout=60 \
--max-test-fail=0 \
%if 0%{ignore_testsuite_result} > 0
|| :
%else
--skip-test=spider \
--skip-test-list=unstable-tests
%endif
%endif
# client does not require server and needs the user too
%pre client -f mysql.pre
%pre
%service_add_pre mariadb.service mariadb.socket mariadb-extra.socket mariadb.target
%post
%service_add_post mariadb.service mariadb@.service mariadb.socket mariadb-extra.socket mariadb.target
%tmpfiles_create %{_tmpfilesdir}/mariadb.conf
%set_permissions %{_libdir}/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
# SLE11 Migration support
for i in protected tmp; do
rmdir "$datadir"/.$i 2>/dev/null || :
done
# During package rename (migration maria->mysql-community-server),
# there might be config file move and we get rpmsave that we should keep
if [ -f %{_sysconfdir}/my.cnf.rpmsave ]; then
mv %{_sysconfdir}/my.cnf{,.rpmnew}
mv %{_sysconfdir}/my.cnf{.rpmsave,}
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-something << EOF
WARNING: %{_sysconfdir}/my.cnf.rpmsave file detected!
This probably means that you are migrating from different variant of MySQL.
Your configuration was left intact and you can see the new configuration in
%{_sysconfdir}/my.cnf.rpmnew
EOF
fi
# Decide if the upgrade is needed
datadir="`%{_bindir}/my_print_defaults mysqld mysql_server | sed -n 's|--datadir=||p'`"
[ -n "$datadir" ] || datadir="%{_localstatedir}/lib/mysql"
# NOTE: .run-mysql_upgrade was moved and renamed to .mariadb_run_upgrade. Remove the old file and
# create a new one if needed.
rm -f "$datadir/.run-mysql_upgrade"
if [ -d "$datadir/mysql" ]; then
touch "%{_localstatedir}/lib/misc/.mariadb_run_upgrade"
fi
# Manage showing of a README or upgrade messages
# NOTE: mysql_upgrade_info was moved and renamed to mariadb_upgrade_info. Copy the content and remove it
if [ -f "$datadir/mysql_upgrade_info" ]; then
cat "$datadir/mysql_upgrade_info" > "%{_localstatedir}/lib/misc/mariadb_upgrade_info"
rm -f "$datadir/mysql_upgrade_info"
fi
if [ \! -f "%{_localstatedir}/lib/misc/mariadb_upgrade_info" ]; then
if [ $1 -eq 1 ]; then
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-something << EOF
%(cat %{_sourcedir}/README.install)
EOF
fi
else
MYSQLVER="`echo %{version} | sed 's|\.[0-9]\+$||'`"
if [ -f "%{_localstatedir}/lib/misc/mariadb_upgrade_info" ] && \
[ -z "`grep "^$MYSQLVER" "%{_localstatedir}/lib/misc/mariadb_upgrade_info" 2> /dev/null`" ]; then
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-something << EOF
WARNING: You are upgrading from different stable version of MySQL!
Your database will be migrated automatically during next restart of MySQL.
Before you do that make sure you have up to date backup of your data. It
should be mainly in $datadir directory.
EOF
fi
fi
exit 0
%verifyscript
%verify_permissions %{_libdir}/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
%preun
%service_del_preun mariadb.service mariadb.socket mariadb-extra.socket mariadb.target
%postun
%service_del_postun mariadb.service mariadb.socket mariadb-extra.socket mariadb.target
%post -n libmariadbd%{soname} -p /sbin/ldconfig
%postun -n libmariadbd%{soname} -p /sbin/ldconfig
%files -f mariadb.files -f mariadb-galera-exclude.files
%config(noreplace) %attr(-, root, mysql) %{_sysconfdir}/my.cnf
%config(noreplace) %attr(-, root, mysql) %{_sysconfdir}/my.cnf.d/
%if %{with galera}
%exclude %{_sysconfdir}/my.cnf.d/50-galera.cnf
%endif
%config(noreplace) %{_pam_secconfdir}/user_map.conf
%config %{_sysconfdir}/logrotate.d/%{name}
%{_datadir}/%{name}/%{name}.logrotate
%doc %{_defaultdocdir}/%{name}
%dir %{_libexecdir}/mysql
%dir %attr(0700, mysql, mysql) %{_localstatedir}/log/mysql
%{_libexecdir}/mysql/mysql-systemd-helper
%{_unitdir}/mariadb.service
%{_unitdir}/mariadb@.service
%{_unitdir}/mariadb.target
%{_unitdir}/mysql.service
%{_unitdir}/mysql@.service
%{_unitdir}/mariadb-extra.socket
%{_unitdir}/mariadb-extra@.socket
%{_unitdir}/mariadb.socket
%{_unitdir}/mariadb@.socket
%{_tmpfilesdir}/mariadb.conf
%{_sbindir}/rcmysql
%{_sbindir}/rcmariadb
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/charsets/
%{_datadir}/%{name}/*.sql
%dir %{_libdir}/mysql
%{_libdir}/mysql/mysqld.sym
%{_libdir}/mysql/INFO_SRC
%dir %{_libdir}/mysql/plugin
%{_libdir}/mysql/plugin/*.so
%exclude %{_libdir}/mysql/plugin/dialog*.so
%if 0%{with_cracklib_plugin} > 0
%exclude %{_libdir}/mysql/plugin/cracklib_password_check.so
%endif
%{_pam_moduledir}/pam_user_map.so
%dir %attr(0750, root, mysql) %{_libdir}/mysql/plugin/auth_pam_tool_dir
%verify(not mode) %attr(4755,root,root) %{_libdir}/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
%ghost %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-something
%dir %attr(0750, mysql, mysql) %{_localstatedir}/lib/mysql-files
%if 0%{with_mroonga} > 0
%{_datadir}/mariadb/mroonga/
%dir %{_datadir}/groonga/
%{_datadir}/groonga/COPYING
%{_datadir}/groonga/README.md
%dir %{_datadir}/groonga-normalizer-mysql
%{_datadir}/groonga-normalizer-mysql/README.md
%{_datadir}/groonga-normalizer-mysql/lgpl-2.0.txt
%endif
%dir %{_datadir}/%{name}/policy
%dir %{_datadir}/%{name}/policy/apparmor
%{_datadir}/%{name}/policy/apparmor/README
%{_datadir}/%{name}/policy/apparmor/usr.sbin.mysqld*
%dir %{_datadir}/%{name}/policy/selinux
%{_datadir}/%{name}/policy/selinux/README
%{_datadir}/%{name}/policy/selinux/mariadb-server.*
%{_datadir}/%{name}/policy/selinux/mariadb.te
%dir %{_datadir}/%{name}/systemd
%{_datadir}/%{name}/systemd/mariadb.service
%{_datadir}/%{name}/systemd/mariadb@.service
%{_datadir}/%{name}/systemd/mariadb-extra@.socket
%{_datadir}/%{name}/systemd/mariadb@.socket
%files rpm-macros
%{_rpmmacrodir}/macros.mariadb-test
%files -n libmariadbd%{soname}
%{_libdir}/libmariadbd.so.*
%files -n libmariadbd-devel
%{_libdir}/libmysqld.so
%{_libdir}/libmariadbd.so
%files client -f mariadb-client.files
%dir %{_libdir}/mysql
%dir %{_libdir}/mysql/plugin
%{_libdir}/mysql/plugin/dialog_examples.so
%{_sysusersdir}/mysql-user.conf
%if %{with galera}
%files galera -f mariadb-galera.files
%doc Docs/README.wsrep
%config(noreplace) %attr(-, root, mysql) %{_sysconfdir}/my.cnf.d/50-galera.cnf
%{_datadir}/%{name}/systemd/use_galera_new_cluster.conf
%{_datadir}/%{name}/wsrep_notify
%endif
%files errormessages -f mariadb-errormessages.files
%{_datadir}/%{name}/*/errmsg.sys
%files bench -f mariadb-bench.files
%{_datadir}/sql-bench
%{_datadir}/%{name}/mini-benchmark
%files test -f mariadb-test.files
%{_bindir}/test-connect-t
%{_mandir}/man1/my_safe_process.1%{?ext_man}
%{_mandir}/man1/mysql-test-run.pl.1%{?ext_man}
%{_mandir}/man1/mysql-stress-test.pl.1%{?ext_man}
%{_datadir}/%{name}-test/valgrind.supp
%dir %attr(755, mysql, mysql) %{_datadir}/%{name}-test
%attr(-, mysql, mysql) %{_datadir}/%{name}-test/[^v]*
%dir %attr(755, mysql, mysql) %{_datadir}/%{name}-test%{_localstatedir}
%files tools -f mariadb-tools.files
%{_bindir}/mysqlrepair
%{_bindir}/mysqlanalyze
%{_bindir}/mysqloptimize
%if 0%{with_cracklib_plugin} > 0
%files cracklib-password-check
%{_libdir}/mysql/plugin/cracklib_password_check.so
%endif
%changelog

2
mariadb.target Normal file
View File

@ -0,0 +1,2 @@
[Unit]
Description=MySQL target allowing to control multi setup

71
mariadb@.service.in Normal file
View File

@ -0,0 +1,71 @@
# It's not recommended to modify this unit file because your changes
# would be overwritten during the package update.
#
# However, there are 2 methods how to customize this unit file:
#
# 1) Copy this unit file from /usr/lib/systemd/system to
# /etc/systemd/system and modify the chosen settings.
#
# 2) Create a directory named mariadb.service.d/ within /etc/systemd/system
# and place a drop-in file name.conf there that only changes the specific
# settings one is interested in.
#
# see systemd.unit(5) for details
#
# Example - increasing of the TimeoutSec= limit
# mkdir /etc/systemd/system/mariadb.service.d
# cat > /etc/systemd/system/mariadb.service.d/timeout.conf << EOF
# [Service]
# TimeoutSec=600
# EOF
[Unit]
Description=MariaDB database server - %I instance
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
PartOf=mariadb.target
After=network.target time-sync.target
[Install]
WantedBy=multi-user.target
Alias=mysql.service
[Service]
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper install %i
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper upgrade %i
ExecStart=@LIBEXECDIR@/mysql/mysql-systemd-helper start %i
Type=notify
User=mysql
Group=mysql
KillSignal=SIGTERM
# Don't want to see an automated SIGKILL ever
SendSIGKILL=no
# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s
# Configures the time to wait for start-up/stop
TimeoutSec=300
# CAP_IPC_LOCK To allow memlock to be used as non-root user
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0
# does nothing for non-root, not needed if /etc/shadow is u+r
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason
CapabilityBoundingSet=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE
# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full
# Prevent accessing /home, /root and /run/user
ProtectHome=true
# Execute pre and post scripts as root, otherwise it does it as User=
PermissionsStartOnly=true
UMask=007

104
my.ini Normal file
View File

@ -0,0 +1,104 @@
# The following options will be passed to all MariaDB clients
[client]
# Please note that storing the password in this file is not safe. For this
# purpose you can, for example, list your password in the [client] section
# of the '~/.my.cnf' configuration file with an access mode set to 400 or 600.
# password = your_password
# port = 3306
# socket = /run/mysql/mysql.sock
# The MariaDB server
[mysqld]
# For security reasons, bind to 127.0.0.1 by default to enable networking
# only on the loopback interface.
bind-address = 127.0.0.1
# If log-error is not set, mysqld will write to "/var/lib/mysql/$HOSTNAME.err"
# which is not beneficial for rotating the log file if it grows in size.
log-error = /var/log/mysql/mysqld.log
# Enable the slow query log to see queries with especially long duration
# slow_query_log=1
# slow_query_log_file = /var/log/mysql/mysqld_slow.log
# Operations 'LOAD DATA', 'SELECT ... INTO' and 'LOAD FILE()' will only
# work with files in the specified directory
secure_file_priv = /var/lib/mysql-files
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin=mysql-bin
# binlog_format=mixed
# Remove leading # if you want to store your database elsewhere
# datadir = /var/lib/mysql
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# These are commonly set, remove the # and set as required.
# port = 3306
# socket = /run/mysql/mysql.sock
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# Configure the MariaDB server to use SSL
# ssl-ca=/etc/mysql/ssl/ca-cert.pem
# ssl-cert=/etc/mysql/ssl/server-cert.pem
# ssl-key=/etc/mysql/ssl/server-key.pem
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
log = /var/log/mysqld_multi.log
# If you want to use mysqld_multi uncomment 1 or more mysqld sections
# below or add your own ones.
# WARNING
# --------
# If you uncomment mysqld1 than make absolutely sure, that database mysql,
# configured above, is not started. This may result in corrupted data!
#
# [mysqld1]
# port = 3306
# datadir = /var/lib/mysql
# pid-file = /var/lib/mysql/mysqld.pid
# socket = /var/lib/mysql/mysql.sock
# user = mysql
# [mysqld2]
# port = 3307
# datadir = /var/lib/mysql-databases/mysqld2
# pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
# socket = /var/lib/mysql-databases/mysqld2/mysql.sock
# user = mysql
# [mysqld3]
# port = 3308
# datadir = /var/lib/mysql-databases/mysqld3
# pid-file = /var/lib/mysql-databases/mysqld3/mysql.pid
# socket = /var/lib/mysql-databases/mysqld3/mysql.sock
# user = mysql
# [mysqld6]
# port = 3309
# datadir = /var/lib/mysql-databases/mysqld6
# pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
# socket = /var/lib/mysql-databases/mysqld6/mysql.sock
# user = mysql
!includedir /etc/my.cnf.d

203
mysql-systemd-helper Normal file
View File

@ -0,0 +1,203 @@
#!/bin/bash
die() {
echo "$1"
exit 1
}
# Read options from config file
read_config() {
# Initial settings
MYSQLVER="$(echo @MYSQLVER@ | sed 's|\.[0-9]\+$||')"
mysql_daemon_user=mysql
mysql_daemon_group=mysql
# status information directory (e.g. info about a necessity of upgrade, current version etc)
mariadb_status_dir="/var/lib/misc"
if [[ -z "$INSTANCE" ]]; then
datadir=/var/lib/mysql
socket="/run/mysql/mysql.sock"
else
datadir="/var/lib/mysql-$INSTANCE"
socket="/run/mysql/mysql.${INSTANCE}.sock"
fi
# Read options - important for multi setup
if [[ -n "$INSTANCE" ]]; then
opts="$(/usr/bin/my_print_defaults --defaults-extra-file=/etc/my${INSTANCE}.cnf mysqld mysqld_multi "$INSTANCE")"
tmp_opts="$opts"
config="/etc/my${INSTANCE}.cnf"
else
opts="$(/usr/bin/my_print_defaults mysqld)"
tmp_opts="$opts"
config="/etc/my.cnf"
fi
# Update local variables according to the settings from config
for arg in $tmp_opts; do
case "$arg" in
--basedir=*) basedir="$(echo "$arg" | sed -e 's/^[^=]*=//')" ;;
--socket=*) socket="$(echo "$arg" | sed -e 's/^[^=]*=//')" ;;
--datadir=*) datadir="$(echo "$arg" | sed -e 's/^[^=]*=//')" ;;
--user=*) mysql_daemon_user="$(echo "$arg" | sed -e 's/^[^=]*=//')" ;;
--group=*) mysql_daemon_group="$(echo "$arg" | sed -e 's/^[^=]*=//')" ;;
esac
done
# work-around for lost+found directory in $datadir (bug #986251)
if [ -d "$datadir/lost+found" ]
then
ignore_db_dir="--ignore-db-dir=lost+found"
else
ignore_db_dir=""
fi
}
# Create new empty database if needed
mysql_install() {
if [[ ! -d "$datadir/mysql" ]]; then
echo "Creating MySQL privilege database... "
mysql_install_db --rpm --user="$mysql_daemon_user" --datadir="$datadir" || \
die "Creation of MySQL database in $datadir failed"
echo -n "$MYSQLVER" > "$mariadb_status_dir"/mariadb_upgrade_info
fi
}
# Upgrade database if needed
mysql_upgrade() {
# Run mysql_upgrade on every package install/upgrade. Not always
# necessary, but doesn't do any harm.
if [[ -f "$mariadb_status_dir/.mariadb_run_upgrade" ]]; then
echo "Checking MySQL configuration for obsolete options..."
sed -i -e 's|^\([[:blank:]]*\)skip-locking|\1skip-external-locking|' \
-e 's|^\([[:blank:]]*skip-federated\)|#\1|' /etc/my.cnf
# instead of running mysqld --bootstrap, which wouldn't allow
# us to run mysql_upgrade, we start a full-featured server with
# --skip-grant-tables and restict access to it by unix
# permissions of the named socket
echo "Trying to run upgrade of MySQL databases..."
# Check whether upgrade process is not already running
protected="$(cat "/run/mysql/protecteddir.$INSTANCE" 2> /dev/null)"
if [[ -n "$protected" && -d "$protected" ]]; then
pid="$(cat "$protected/mysqld.pid" 2> /dev/null)"
if [[ "$pid" && -d "/proc/$pid" ]] &&
[[ $(readlink "/proc/$pid/exe" | grep -q "mysql") ]]; then
die "Another upgrade in already in progress!"
else
echo "Stale files from previous upgrade detected, cleaned them up"
rm -rf "$protected"
rm -f "/run/mysql/protecteddir.$INSTANCE"
fi
fi
protected="$(mktemp -d -p /var/tmp mysql-protected.XXXXXX | tee "/run/mysql/protecteddir.$INSTANCE")"
[ -n "$protected" ] || die "Can't create a tmp dir '$protected'"
# Create a secure tmp dir
chown --no-dereference "$mysql_daemon_user:$mysql_daemon_group" "$protected" || die "Failed to set group/user to '$protected'"
chmod 0700 "$protected" || die "Failed to set permissions to '$protected'"
# Run protected MySQL accessible only though socket in our directory
echo "Running protected MySQL... "
/usr/sbin/mysqld \
--defaults-file="$config" \
--user="$mysql_daemon_user" \
--skip-networking \
--skip-grant-tables \
$ignore_db_dir \
--log-error="$protected/log_upgrade_run" \
--socket="$protected/mysql.sock" \
--pid-file="$protected/mysqld.pid" &
mysql_wait "$protected/mysql.sock" || die "MySQL didn't start, can't continue"
# Run upgrade itself
echo "Running upgrade itself..."
echo "It will do some chek first and report all errors and tries to correct them"
echo
if /usr/bin/mysql_upgrade --no-defaults --force --socket="$protected/mysql.sock"; then
echo "Everything upgraded successfully"
up_ok=""
rm -f "$mariadb_status_dir/.mariadb_run_upgrade"
[[ $(grep -q "^$MYSQLVER" "$mariadb_status_dir/mariadb_upgrade_info" 2> /dev/null) ]] || \
echo -n "$MYSQLVER" > "$mariadb_status_dir/mariadb_upgrade_info"
else
echo "Upgrade failed"
up_ok="false"
fi
# Shut down MySQL
echo "Shutting down protected MySQL"
protected_pid=$(cat "$protected/mysqld.pid")
kill $protected_pid
for i in {1..30}; do
/usr/bin/mysqladmin --socket="$protected/mysql.sock" ping > /dev/null 2>&1
# Check both ping response and the pid in a process list as it can take some time till the process is terminated.
# Otherwise it can lead to "found left-over process" situation when regular mariadb is started.
if [[ $? -eq 1 ]] && ! ps -p $protected_pid > /dev/null 2>&1; then
break
fi
sleep 1
done
/usr/bin/mysqladmin --socket="$protected/mysql.sock" ping > /dev/null 2>&1 && kill -9 $protected_pid
# Cleanup
echo "Final cleanup"
if [[ -z "$up_ok" ]]; then
rm -rf "$protected" "/run/mysql/protecteddir.$INSTANCE"
else
die "Something failed during upgrade, please check logs"
fi
fi
}
mysql_wait() {
[[ -z "$1" ]] || socket="$1"
echo "Waiting for MySQL to start"
for i in {1..60}; do
/usr/bin/mysqladmin --socket="$socket" ping > /dev/null 2>&1 && break
sleep 1
done
if /usr/bin/mysqladmin --socket="$socket" ping > /dev/null 2>&1; then
echo "MySQL is alive"
return 0
else
echo "MySQL is still dead"
return 1
fi
}
mysql_start() {
exec /usr/sbin/mysqld \
--defaults-file="$config" \
$ignore_db_dir \
--user="$mysql_daemon_user" \
--socket="$socket"
}
# We rely on output in english at some points
LC_ALL=C
INSTANCE="$2"
read_config
# Make sure that /run/mysql is created and has correct permissions (bsc#1038740)
systemd-tmpfiles --create /usr/lib/tmpfiles.d/mariadb.conf
case "$1" in
install)
mysql_install ;;
upgrade)
mysql_upgrade ;;
start)
mysql_start ;;
wait)
mysql_wait ;;
*)
echo "Supported commands are:"
echo " install - creates empty database if needed"
echo " upgrade - tries to migrate data to newer version if needed"
echo " start - tries to start instance"
echo " wait - waits till instance is pingable"
echo "All commands can take extra argument which is group from 'mysqld_multi' you want to work with"
;;
esac

2
mysql-user.conf Normal file
View File

@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
u mysql 60 "MySQL database admin" /var/lib/mysql

8
series Normal file
View File

@ -0,0 +1,8 @@
mariadb-10.2.4-logrotate.patch -p0
mariadb-10.1.1-mysqld_multi-features.patch -p0
mariadb-10.0.15-logrotate-su.patch -p0
mariadb-10.2.4-fortify-and-O.patch -p0
mariadb-10.2.19-link-and-enable-c++11-atomics.patch -p1
mariadb-10.4.12-harden_setuid.patch -p1
mariadb-10.4.12-fix-install-db.patch -p1
fix-lock-rollback-assert-abort.patch

17
suse-test-run Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/perl
#
# Test the SUSE mariadb package using the mysql-test framework
my $id = getpwnam("mysql") or die "can't find user \"mysql\": $!";
my $dir = "/usr/share/mysql-test/";
if ($< == 0) {
($<, $>) = ($id, $id);
if ($< != $id || $> != $id) {
die "can't switch to user mysql(id $id): $!";
}
}
chdir($dir) or die "can't cd to $dir: $!";
exec("./mysql-test-run.pl", "--big-test", @ARGV);
die "can't execute mysql-test-run.pl: $!";

47
suse_skipped_tests.list Normal file
View File

@ -0,0 +1,47 @@
#----------------------------------------------------------------
type_test.type_test_double : since 10.5.6 - all
main.mysql_upgrade : since 10.7.3 - x86_64
binlog_encryption.rpl_cant_read_event_incident : since 10.9.2 - all
rpl.rpl_perfschema_applier_status_by_coordinator : since 10.9.2 - all
rpl.rpl_xa_survive_disconnect_lsu_off : since 10.9.2 - all
rpl.rpl_cant_read_event_incident : since 10.9.2 - all
rpl.rpl_heartbeat_basic : since 10.9.2 - all
rpl.rpl_xa_survive_disconnect : since 10.9.2 - all
rpl.rpl_report_port : since 10.9.2 - all
rpl.rpl_reset_slave_fail : since 10.9.2 - all
rpl.rpl_domain_id_filter_restart : since 10.9.2 - all
rpl.rpl_upgrade_master_info : since 10.9.2 - all
rpl.rpl_rewrite_db_sys_vars : since 10.11.2 - all
binlog_encryption.rpl_gtid_basic : since 11.1.2 - all
multi_source.info_logs : since 11.1.2 - all
rpl.rpl_change_master_demote : since 11.1.2 - all
rpl.rpl_mdev6020 : since 11.1.2 - all
rpl.rpl_trigger : since 11.1.2 - all
rpl.rpl_semi_sync_wait_point : since 11.1.2 - all
rpl.rpl_err_ignoredtable : since 11.1.2 - all
rpl.rpl_old_master : since 11.1.2 - all
rpl.rpl_gtid_basic : since 11.1.2 - all
rpl.rpl_slave_shutdown_mdev20821 : since 11.1.2 - all
main.userstat : since 11.1.2 - all
perfschema.threads_mysql : since 11.1.2 - all
main.information_schema : since 11.1.2 - all
main.ssl_crl : since 11.1.2 - all
perfschema.nesting : since 11.1.2 - all
perfschema.socket_summary_by_event_name_func : since 11.1.2 - all
perfschema.socket_summary_by_instance_func : since 11.1.2 - all
main.lock_kill : since 11.1.2 - all
main.loadxml : since 11.1.2 - all
sys_vars.tcp_nodelay : since 11.1.2 - all
perfschema.show_aggregate : since 11.2.3 - all
main.mdev375 : since 11.2.3 - all
main.func_json_notembedded : since 11.2.3 - s390x
mariabackup.encrypted_page_corruption : since 11.2.3 - s390x
main.ssl_autoverify : since 11.4.2 - all
binlog.max_binlog_total_size : since 11.4.2 - all