diff --git a/.gitignore b/.gitignore index ec4c75d..d3fc221 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mariadb-10.2.8.tar.gz +SOURCES/mariadb-10.2.22.tar.gz diff --git a/.rh-mariadb102-mariadb.metadata b/.rh-mariadb102-mariadb.metadata index a61a281..7e05152 100644 --- a/.rh-mariadb102-mariadb.metadata +++ b/.rh-mariadb102-mariadb.metadata @@ -1 +1 @@ -80dcd455986eec254fc81b6bbedd4a542e8af495 SOURCES/mariadb-10.2.8.tar.gz +e44e661b995d01f05abeae1eb3fa480506b910d7 SOURCES/mariadb-10.2.22.tar.gz diff --git a/SOURCES/mariadb-galera-macros.patch b/SOURCES/mariadb-galera-macros.patch index b43a8cc..daff44a 100644 --- a/SOURCES/mariadb-galera-macros.patch +++ b/SOURCES/mariadb-galera-macros.patch @@ -1,12 +1,12 @@ diff -up mariadb-10.2.6/scripts/galera_recovery.sh.newpatch mariadb-10.2.6/scripts/galera_recovery.sh ---- mariadb-10.2.6/scripts/galera_recovery.sh.newpatch 2017-06-26 10:46:52.143445636 +0200 -+++ mariadb-10.2.6/scripts/galera_recovery.sh 2017-06-26 10:48:01.666569584 +0200 +--- mariadb-10.2.17/scripts/galera_recovery.sh 2018-08-12 13:29:50.000000000 +0200 ++++ mariadb-10.2.17/scripts/galera_recovery.sh_patched 2018-09-09 03:52:22.227621846 +0200 @@ -68,7 +68,7 @@ parse_arguments() { wsrep_recover_position() { # Redirect server's error log to the log file. -- eval /usr/sbin/mysqld $cmdline_args --user=$user --wsrep_recover \ +- eval @sbindir@/mysqld $cmdline_args --user=$user --wsrep_recover \ + eval @libexecdir@/mysqld $cmdline_args --user=$user --wsrep_recover \ - --log-error="$log_file" + --disable-log-error 2> "$log_file" ret=$? if [ $ret -ne 0 ]; then diff --git a/SOURCES/mariadb-galera-new-cluster-init.patch b/SOURCES/mariadb-galera-new-cluster-init.patch index fb55cde..98ca9dd 100644 --- a/SOURCES/mariadb-galera-new-cluster-init.patch +++ b/SOURCES/mariadb-galera-new-cluster-init.patch @@ -1,14 +1,15 @@ -diff -up mariadb-10.2.6/scripts/galera_new_cluster.sh.p42 mariadb-10.2.6/scripts/galera_new_cluster.sh ---- mariadb-10.2.6/scripts/galera_new_cluster.sh.p42 2017-06-18 22:08:10.921574458 +0200 -+++ mariadb-10.2.6/scripts/galera_new_cluster.sh 2017-06-18 22:13:58.836159661 +0200 -@@ -24,7 +24,13 @@ fi - VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" - COMPILATION_COMMENT="@COMPILATION_COMMENT@" +diff -Naurp mariadb-10.2.18/scripts/galera_new_cluster.sh mariadb-10.2.18/scripts/galera_new_cluster.sh_patched +--- mariadb-10.2.18/scripts/galera_new_cluster.sh 2018-10-04 16:03:52.428556126 +0200 ++++ mariadb-10.2.18/scripts/galera_new_cluster.sh_patched 2018-10-04 16:05:34.139765818 +0200 +@@ -21,7 +21,12 @@ EOF + exit 0 + fi -systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \ - systemctl start ${1:-@DAEMON_NAME@} +echo "_WSREP_NEW_CLUSTER='--wsrep-new-cluster'" >> @sysconfdir@/sysconfig/mariadb -+ + +-systemctl set-environment _WSREP_NEW_CLUSTER='' +service @DAEMON_NAME@ start + +EXIT_CODE=$? @@ -16,5 +17,3 @@ diff -up mariadb-10.2.6/scripts/galera_new_cluster.sh.p42 mariadb-10.2.6/scripts +sed -i -r "/^_WSREP_NEW_CLUSTER='--wsrep-new-cluster'$/d" @sysconfdir@/sysconfig/mariadb + +exit $EXIT_CODE - --systemctl set-environment _WSREP_NEW_CLUSTER='' diff --git a/SOURCES/mariadb-galera.cnf.patch b/SOURCES/mariadb-galera.cnf.patch deleted file mode 100644 index 6ea6c60..0000000 --- a/SOURCES/mariadb-galera.cnf.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- mariadb-10.1.11/support-files/wsrep.cnf.sh.orig 2016-04-06 16:55:28.429983803 +0200 -+++ mariadb-10.1.11/support-files/wsrep.cnf.sh 2016-04-06 16:56:02.194964351 +0200 -@@ -30,6 +30,9 @@ bind-address=0.0.0.0 - ## WSREP options - ## - -+# Enable wsrep -+wsrep_on=1 -+ - # Full path to wsrep provider library or 'none' - wsrep_provider=none - diff --git a/SOURCES/mariadb-install-db-sharedir.patch b/SOURCES/mariadb-install-db-sharedir.patch deleted file mode 100644 index 7595d24..0000000 --- a/SOURCES/mariadb-install-db-sharedir.patch +++ /dev/null @@ -1,40 +0,0 @@ -Use configured value instead of hardcoded path - -diff -up mariadb-10.1.19/scripts/mysql_install_db.pl.in.pbasedir mariadb-10.1.19/scripts/mysql_install_db.pl.in ---- mariadb-10.1.19/scripts/mysql_install_db.pl.in.pbasedir 2016-11-19 13:08:53.882777759 +0100 -+++ mariadb-10.1.19/scripts/mysql_install_db.pl.in 2016-11-19 13:08:53.880777758 +0100 -@@ -320,7 +320,7 @@ elsif ( $opt->{basedir} ) - find_in_basedir($opt,"file","mysqld-nt", - "bin"); # ,"sql" - $srcpkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql", -- "share","share/mysql"); # ,"scripts" -+ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts" - $buildpkgdir = $srcpkgdatadir; - $scriptdir = "$opt->{basedir}/scripts"; - } -diff -up mariadb-10.1.19/mysql-test/mysql-test-run.pl.pbasedir mariadb-10.1.19/mysql-test/mysql-test-run.pl -diff -up mariadb-10.1.19/scripts/mysql_install_db.sh.pbasedir mariadb-10.1.19/scripts/mysql_install_db.sh ---- mariadb-10.1.19/scripts/mysql_install_db.sh.pbasedir 2016-12-20 14:53:05.118823806 +0100 -+++ mariadb-10.1.19/scripts/mysql_install_db.sh 2016-12-20 16:35:10.888834851 +0100 -@@ -283,17 +283,17 @@ then - cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin - exit 1 - fi -- langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english` -+ langdir=`find_in_basedir --dir errmsg.sys share/english @INSTALL_MYSQLSHAREDIR@/english` - if test -z "$langdir" - then -- cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english -+ cannot_find_file errmsg.sys $basedir/share/english $basedir/@INSTALL_MYSQLSHAREDIR@/english - exit 1 - fi -- srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` -+ srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share @INSTALL_MYSQLSHAREDIR@` - buildpkgdatadir=$srcpkgdatadir - if test -z "$srcpkgdatadir" - then -- cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql -+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/@INSTALL_MYSQLSHAREDIR@ - exit 1 - fi - scriptdir="$basedir/scripts" diff --git a/SOURCES/mariadb-install-test.patch b/SOURCES/mariadb-install-test.patch deleted file mode 100644 index e085599..0000000 --- a/SOURCES/mariadb-install-test.patch +++ /dev/null @@ -1,55 +0,0 @@ -Improve the documentation that will be installed in the mysql-test RPM. - ---- mariadb-10.1.13/mysql-test/README.orig 2016-03-24 10:12:10.000000000 +0100 -+++ mariadb-10.1.13/mysql-test/README 2016-03-29 10:23:30.074326900 +0200 -@@ -1,15 +1,28 @@ --This directory contains a test suite for the MySQL daemon. To run --the currently existing test cases, simply execute ./mysql-test-run in --this directory. It will fire up the newly built mysqld and test it. -- --Note that you do not have to have to do "make install", and you could --actually have a co-existing MySQL installation. The tests will not --conflict with it. To run the test suite in a source directory, you --must do make first. -- --All tests must pass. If one or more of them fail on your system, please --read the following manual section for instructions on how to report the --problem: -+This directory contains a test suite for the MariaDB daemon. To run -+the currently existing test cases, execute ./mysql-test-run in -+this directory. -+ -+For use in Red Hat distributions, you should run the script as user mysql, -+who is created with nologin shell however, so the best bet is something like -+ $ su - -+ # cd /usr/share/mysql-test -+ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list" -+ -+This will use the installed mysql executables, but will run a private copy -+of the server process (using data files within /usr/share/mysql-test), -+so you need not start the mysqld service beforehand. -+ -+The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are -+known to fail on one or more Red-Hat-supported platforms. You can omit it -+if you want to check whether such failures occur for you. Documentation -+about the reasons for omitting such tests can be found in the file -+rh-skipped-tests.list. -+ -+To clean up afterwards, remove the created "var" subdirectory, eg -+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var" -+ -+If one or more tests fail on your system, please read the following manual -+section for instructions on how to report the problem: - - https://mariadb.com/kb/en/reporting-bugs - -@@ -26,7 +39,8 @@ other relevant options. - - With no test cases named on the command line, mysql-test-run falls back - to the normal "non-extern" behavior. The reason for this is that some --tests cannot run with an external server. -+tests cannot run with an external server (because they need to control the -+options with which the server is started). - - You can create your own test cases. To create a test case, create a new - file in the t subdirectory using a text editor. The file should have a .test diff --git a/SOURCES/mariadb-recoverpath.patch b/SOURCES/mariadb-recoverpath.patch new file mode 100644 index 0000000..90909f2 --- /dev/null +++ b/SOURCES/mariadb-recoverpath.patch @@ -0,0 +1,22 @@ +Upstream changed location of the temporary file in the wsrep_recover_position +function, which causes issues on RHEL-6, because mysqld_safe is not expected +to play with files in /tmp, and SELinux started to complain. + +Changing the location of the temporary files to the datadir means practically +reverting part of the upstream commit +https://github.com/MariaDB/server/commit/bb7a70c9551c1756b1d1736ca4f6a0a965795873 + +Upstream issue: https://jira.mariadb.org/browse/MDEV-10767 + +diff -up mariadb-10.1.29/scripts/mysqld_safe.sh.recoverpath mariadb-10.1.29/scripts/mysqld_safe.sh +--- mariadb-10.1.29/scripts/mysqld_safe.sh.recoverpath 2017-11-23 10:48:37.538678722 +0100 ++++ mariadb-10.1.29/scripts/mysqld_safe.sh 2017-11-23 10:50:48.134585794 +0100 +@@ -246,7 +246,7 @@ wsrep_recover_position() { + local euid=$(id -u) + local ret=0 + +- local wr_logfile=$(mktemp /tmp/wsrep_recovery.XXXXXX) ++ local wr_logfile=$(mktemp $DATADIR/wsrep_recovery.XXXXXX) + + # safety checks + if [ -z $wr_logfile ]; then diff --git a/SOURCES/mariadb-scl-env-check.patch b/SOURCES/mariadb-scl-env-check.patch index 1876293..d9c3191 100644 --- a/SOURCES/mariadb-scl-env-check.patch +++ b/SOURCES/mariadb-scl-env-check.patch @@ -14,19 +14,19 @@ diff -up mariadb-10.2.8/scripts/mysqld_safe.sh.p90 mariadb-10.2.8/scripts/mysqld # Initialize script globals KILL_MYSQLD=1; MYSQLD= -diff -up mariadb-10.2.8/scripts/mysql.init.in.p90 mariadb-10.2.8/scripts/mysql.init.in ---- mariadb-10.2.8/scripts/mysql.init.in.p90 2017-09-21 21:47:46.125058730 +0200 -+++ mariadb-10.2.8/scripts/mysql.init.in 2017-09-21 21:50:28.505677217 +0200 -@@ -72,7 +72,7 @@ start(){ - ret=0 - else +diff -up mariadb-10.2.8/scripts/mysql.init.in_patched mariadb-10.2.8/scripts/mysql.init.in +--- mariadb-10.2.8/scripts/mysql.init.in_patched 2019-04-16 15:21:21.507306567 +0200 ++++ mariadb-10.2.8/scripts/mysql.init.in 2019-04-16 14:53:08.519336544 +0200 +@@ -104,7 +104,7 @@ start(){ @libexecdir@/mysql-check-socket || return 1 + # KNOWN ISSUE: Per standard, following line should return '1' on error + # Leaving '4' for behaviour compatibility with released versions of this script - su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4 + su - $MYUSER -s /bin/bash -c "scl enable @SCL_NAME@ -- @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4 # Pass all the options determined above, to ensure consistent behavior. # In many cases mysqld_safe would arrive at the same conclusions anyway -@@ -81,13 +81,13 @@ start(){ +@@ -113,13 +113,13 @@ start(){ # and some users might prefer to configure logging to syslog.) # Note: set --basedir to prevent probes that might trigger SELinux # alarms, per bug #547485 @@ -42,7 +42,7 @@ diff -up mariadb-10.2.8/scripts/mysql.init.in.p90 mariadb-10.2.8/scripts/mysql.i ret=$? if [ $ret -eq 0 ]; then -@@ -154,6 +154,18 @@ condrestart(){ +@@ -197,6 +197,18 @@ condrestart(){ [ -e $lockfile ] && restart || : } @@ -77,17 +77,19 @@ diff -up mariadb-10.2.8/scripts/mysql_install_db.sh.p90 mariadb-10.2.8/scripts/m basedir="" builddir="" ldata="@localstatedir@" -@@ -480,16 +486,16 @@ else +--- mariadb-10.2.17/scripts/mysql_install_db.sh 2018-08-12 13:29:50.000000000 +0200 ++++ mariadb-10.2.17/scripts/mysql_install_db.sh_patched 2018-09-09 05:18:41.193087156 +0200 +@@ -497,16 +497,16 @@ else echo "The problem could be conflicting information in an external" echo "my.cnf files. You can ignore these by doing:" echo -- echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf" +- echo " shell> $0 --defaults-file=~/.my.cnf" + echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf'" echo echo "You can also try to start the mysqld daemon with:" echo -- echo " shell> $mysqld --skip-grant --general-log &" -+ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $mysqld --skip-grant --general-log &'" +- echo " shell> $mysqld --skip-grant-tables --general-log &" ++ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $mysqld --skip-grant-tables --general-log &'" echo echo "and use the command line tool $bindir/mysql" echo "to connect to the mysql database and look at the grant tables:" @@ -97,7 +99,7 @@ diff -up mariadb-10.2.8/scripts/mysql_install_db.sh.p90 mariadb-10.2.8/scripts/m echo " mysql> show tables;" echo echo "Try 'mysqld --help' if you have problems with paths. Using" -@@ -509,19 +515,15 @@ fi +@@ -526,10 +526,6 @@ fi # the screen. if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" then @@ -105,22 +107,25 @@ diff -up mariadb-10.2.8/scripts/mysql_install_db.sh.p90 mariadb-10.2.8/scripts/m - s_echo "To start mysqld at boot time you have to copy" - s_echo "support-files/mysql.server to the right place for your system" - - echo - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !" - echo "To do so, start the server, then issue the following commands:" - echo -- echo "'$bindir/mysqladmin' -u root password 'new-password'" -- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'" -+ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root password 'new-password'" -+ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root -h $hostname password 'new-password'" - echo - echo "Alternatively you can run:" -- echo "'$bindir/mysql_secure_installation'" -+ echo "scl enable @SCL_NAME@ -- '$bindir/mysql_secure_installation'" - echo - echo "which will also give you the option of removing the test" - echo "databases and anonymous user created by default. This is" -@@ -537,7 +539,8 @@ then + if test "$auth_root_authentication_method" = normal + then + echo +@@ -537,11 +533,11 @@ then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !" + echo "To do so, start the server, then issue the following commands:" + echo +- echo "'$bindir/mysqladmin' -u root password 'new-password'" +- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root password 'new-password'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root -h $hostname password 'new-password'" + echo + echo "Alternatively you can run:" +- echo "'$bindir/mysql_secure_installation'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysql_secure_installation'" + echo + echo "which will also give you the option of removing the test" + echo "databases and anonymous user created by default. This is" +@@ -559,7 +555,8 @@ then echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'" echo echo "You can test the MariaDB daemon with mysql-test-run.pl" @@ -128,7 +133,7 @@ diff -up mariadb-10.2.8/scripts/mysql_install_db.sh.p90 mariadb-10.2.8/scripts/m + echo "after installing @SCL_NAME@-mariadb-test package." + echo "See @prefix@/share/mysql-test/README for instructions." fi - + echo diff -up mariadb-10.2.8/scripts/mysql.service.in.p90 mariadb-10.2.8/scripts/mysql.service.in --- mariadb-10.2.8/scripts/mysql.service.in.p90 2017-09-21 21:47:46.123058725 +0200 diff --git a/SOURCES/mariadb-scripts.patch b/SOURCES/mariadb-scripts.patch index 72abe5e..865853c 100644 --- a/SOURCES/mariadb-scripts.patch +++ b/SOURCES/mariadb-scripts.patch @@ -1,14 +1,13 @@ 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. - -diff -up mariadb-10.2.8/scripts/CMakeLists.txt.p7 mariadb-10.2.8/scripts/CMakeLists.txt ---- mariadb-10.2.8/scripts/CMakeLists.txt.p7 2017-08-28 22:35:58.589879693 +0200 -+++ mariadb-10.2.8/scripts/CMakeLists.txt 2017-08-28 22:34:10.463434154 +0200 -@@ -338,6 +338,35 @@ ELSE() +--- mariadb-10.2.16/scripts/CMakeLists.txt 2018-06-25 13:13:26.000000000 +0200 ++++ mariadb-10.2.16/scripts/CMakeLists.txt_patched 2018-06-29 13:32:12.538880486 +0200 +@@ -360,6 +360,36 @@ ELSE() + COMPONENT ${${file}_COMPONENT} ) ENDFOREACH() - ++ + # files for systemd + SET(SYSTEMD_SCRIPTS + mysql.tmpfiles.d diff --git a/SOURCES/mariadb-servicename.patch b/SOURCES/mariadb-servicename.patch index 6e28974..841668c 100644 --- a/SOURCES/mariadb-servicename.patch +++ b/SOURCES/mariadb-servicename.patch @@ -1,8 +1,8 @@ -diff -up mariadb-10.1.11/scripts/galera_new_cluster.sh.servicename mariadb-10.1.11/scripts/galera_new_cluster.sh ---- mariadb-10.1.11/scripts/galera_new_cluster.sh.servicename 2016-02-11 13:57:39.739360761 +0100 -+++ mariadb-10.1.11/scripts/galera_new_cluster.sh 2016-02-11 13:57:56.017395496 +0100 -@@ -9,6 +9,6 @@ VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" - COMPILATION_COMMENT="@COMPILATION_COMMENT@" +diff -up mariadb-10.1.11/scripts/galera_new_cluster.sh mariadb-10.1.11/scripts/galera_new_cluster.sh_patched +--- mariadb-10.2.18/scripts/galera_new_cluster.sh 2018-09-25 01:48:03.000000000 +0200 ++++ mariadb-10.2.18/scripts/galera_new_cluster.sh_patched 2018-10-02 16:56:33.804555618 +0200 +@@ -22,6 +22,6 @@ EOF + fi systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \ - systemctl start ${1:-mariadb} diff --git a/SOURCES/mariadb-strmov.patch b/SOURCES/mariadb-strmov.patch index 1a765c7..c8c9a33 100644 --- a/SOURCES/mariadb-strmov.patch +++ b/SOURCES/mariadb-strmov.patch @@ -13,13 +13,11 @@ of any real performance gain from optimizing these calls. So I'm keeping this patch. MariaDB upstream ticket: https://jira.mariadb.org/browse/MDEV-11752 - -diff -up mariadb-10.2.6/include/m_string.h.p1 mariadb-10.2.6/include/m_string.h ---- mariadb-10.2.6/include/m_string.h.p1 2017-06-18 18:37:00.772596153 +0200 -+++ mariadb-10.2.6/include/m_string.h 2017-06-18 18:37:42.283542656 +0200 -@@ -74,14 +74,6 @@ extern void *(*my_str_malloc)(size_t); - extern void *(*my_str_realloc)(void *, size_t); - extern void (*my_str_free)(void *); +--- mariadb-10.2.17/include/m_string.h 2018-08-12 13:29:49.000000000 +0200 ++++ mariadb-10.2.17/include/m_string.h_patched 2018-09-09 03:33:06.923985821 +0200 +@@ -65,14 +65,6 @@ + extern "C" { + #endif -#ifdef DBUG_OFF -#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) diff --git a/SOURCES/mysql.init.in b/SOURCES/mysql.init.in index aa3b809..3e09882 100644 --- a/SOURCES/mysql.init.in +++ b/SOURCES/mysql.init.in @@ -52,26 +52,58 @@ start(){ return 4 fi - # check to see if it's already running + # Check if PID file exists (which should indicate, the daemon is already running) MYSQLDRUNNING=0 if [ -f "$pidfile" ]; then - MYSQLPID=`cat "$pidfile" 2>/dev/null` + MYSQLPID=`su - $MYUSER -s /bin/bash -c "cat $pidfile 2>/dev/null"` if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then - MYSQLDRUNNING=1 + # Test that the read data is an integer + if [ 1 -ne `echo $MYSQLPID | grep -c -E "^[0-9]+$"` ] ; then + # Set an error value + MYSQLDRUNNING=2 + else + MYSQLDRUNNING=1 + fi fi fi + + # Ping the socket to check, if there's already a running server on that socket RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` - if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then - # already running, do nothing - action $"Starting $prog: " /bin/true - ret=0 - elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user" - then - # already running, do nothing - action $"Starting $prog: " /bin/true - ret=0 + if [ $? = 0 ] || echo "$RESPONSE" | grep -q "Access denied for user" + then + if [ $MYSQLDRUNNING = 0 ]; then + # PID file does not exist, but the server is responsive = different server, or server with different configuration, is running, fail to prevent damage + echo "Socket already in use by a different, responding server" >&2 + action $"Starting $prog: " /bin/false + return 1 + elif [ $MYSQLDRUNNING = 1 ]; then + # PID file is valid and server is responsive = already running, do nothing + action $"Starting $prog: " /bin/true + ret=0 + elif [ $MYSQLDRUNNING = 2 ]; then + # PID file contains garbage, but the server is responsive. Notify admin and fail. + echo "Socket already in use by a different, responding server" >&2 + echo "PID file does not contain an integer. Please investigate." >&2 + action $"Starting $prog: " /bin/false + return 1 + fi else + if [ $MYSQLDRUNNING = 1 ]; then + # If the PID file exist by any reason, but there is no response on the socket, notify the admin and fail. + # The PID might be in use by a server which configured different socket + echo "PID file already exists. It might belong to a living process. Please investigate." >&2 + action $"Starting $prog: " /bin/false + return 1 + elif [ $MYSQLDRUNNING = 2 ]; then + # If the PID file exist, but contains garbage, and there is no response on the socket, notify the admin and fail. + echo "PID file already exists. However it does not contain an integer. Please investigate." >&2 + action $"Starting $prog: " /bin/false + return 1 + fi + @libexecdir@/mysql-check-socket || return 1 + # KNOWN ISSUE: Per standard, following line should return '1' on error + # Leaving '4' for behaviour compatibility with released versions of this script su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4 # Pass all the options determined above, to ensure consistent behavior. @@ -107,19 +139,30 @@ stop(){ action $"Stopping $prog: " /bin/true return 0 fi - MYSQLPID=`cat "$pidfile" 2>/dev/null` + + MYSQLPID=`su - $MYUSER -s /bin/bash -c "cat $pidfile 2>/dev/null"` + + # Test that the read data is an integer + if [ 1 -ne `echo $MYSQLPID | grep -c -E "^[0-9]+$"` ] ; then + echo "PIDfile does not contain a number. Please investigate." >&2 + action $"Stopping $prog: " /bin/false + return 1 + fi + if [ -n "$MYSQLPID" ]; then if ! [ -d "/proc/$MYSQLPID" ] ; then # process doesn't run anymore action $"Stopping $prog: " /bin/true return 0 fi - /bin/kill "$MYSQLPID" >/dev/null 2>&1 + # Drop priviledges before calling kill + su - $MYUSER -s /bin/bash -c "/bin/kill $MYSQLPID" >/dev/null 2>&1 ret=$? if [ $ret -eq 0 ]; then TIMEOUT="$STOPTIMEOUT" while [ $TIMEOUT -gt 0 ]; do - /bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break + # Drop priviledges before calling kill + su - $MYUSER -s /bin/bash -c "/bin/kill -0 $MYSQLPID" >/dev/null 2>&1 || break sleep 1 let TIMEOUT=${TIMEOUT}-1 done diff --git a/SOURCES/rh-skipped-tests-arm.list b/SOURCES/rh-skipped-tests-arm.list index 92d9a47..e69de29 100644 --- a/SOURCES/rh-skipped-tests-arm.list +++ b/SOURCES/rh-skipped-tests-arm.list @@ -1 +0,0 @@ -connect.tbl_thread : bz#1462836 diff --git a/SOURCES/rh-skipped-tests-base.list b/SOURCES/rh-skipped-tests-base.list index 8c2f01d..430e597 100644 --- a/SOURCES/rh-skipped-tests-base.list +++ b/SOURCES/rh-skipped-tests-base.list @@ -1,33 +1 @@ -# failed tests tracked in bz#1462836 - -spider/bg.spider3_fixes : -spider/bg.spider3_fixes_part : -spider/bg.spider_fixes : -spider/bg.spider_fixes_part : -spider/bg.basic_sql : -spider/bg.basic_sql_part : -spider/bg.direct_aggregate : -spider/bg.direct_aggregate_part : -spider/bg.direct_update : -spider/bg.direct_update_part : -spider/bg.function : -spider/bg.ha : -spider/bg.ha_part : -spider/bg.vp_fixes : -spider.spider3_fixes : -spider.spider3_fixes_part : -spider.spider_fixes : -spider.spider_fixes_part : -spider.basic_sql_part : -spider.direct_aggregate : -spider.direct_aggregate_part : -spider.direct_update : -spider.direct_update_part : -spider.function : -spider.ha : -spider.ha_part : -spider.vp_fixes : - -perfschema.bad_option_1 : bz#1462836 -perfschema.bad_option_5 : bz#1462836 - +main.mysqldump : diff --git a/SOURCES/rh-skipped-tests-s390.list b/SOURCES/rh-skipped-tests-s390.list index 1f66749..fd8dbea 100644 --- a/SOURCES/rh-skipped-tests-s390.list +++ b/SOURCES/rh-skipped-tests-s390.list @@ -1,2 +1,2 @@ -gcol_column_def_options_innodb : bz#1462836 -gcol_column_def_options_myisam : bz#1462836 +sys_vars.innodb_ft_result_cache_limit_32 : +main.func_regexp_pcre : diff --git a/SPECS/mariadb.spec b/SPECS/mariadb.spec index d963fbd..279ce7b 100644 --- a/SPECS/mariadb.spec +++ b/SPECS/mariadb.spec @@ -66,15 +66,7 @@ %bcond_without gssapi # rocksdb currently disabled for SCL -%ifarch x86_64 ppc64le aarch64 armv7hl %bcond_with rocksdb -%else -%if 0%{?scl:1} -%bcond_with rocksdb -%else -%bcond_without rocksdb -%endif -%endif %if 0%{?scl:1} %bcond_with embedded @@ -111,7 +103,7 @@ # MariaDB 10.0 and later requires pcre >= 8.35, otherwise we need to use # the bundled library, since the package cannot be build with older version -%global pcre_version 8.41 +%global pcre_version 8.42 %if 0%{?fedora} >= 21 %bcond_without pcre %else @@ -170,7 +162,7 @@ # Make long macros shorter %global sameevr %{epoch}:%{version}-%{release} %global compatver 10.2 -%global bugfixver 8 +%global bugfixver 22 %if 0%{?scl:1} %global scl_upper %{lua:print(string.upper(string.gsub(rpm.expand("%{scl}"), "-", "_")))} @@ -178,7 +170,7 @@ Name: %{?scl_prefix}mariadb Version: %{compatver}.%{bugfixver} -Release: 5%{?with_debug:.debug}%{?dist} +Release: 1%{?with_debug:.debug}%{?dist} Epoch: 1 Summary: A community developed branch of MySQL @@ -216,11 +208,9 @@ Source72: mariadb-server-galera.te # Comments for these patches are in the patch files # Patches common for more mysql-like packages Patch1: %{pkgnamepatch}-strmov.patch -Patch2: %{pkgnamepatch}-install-test.patch Patch4: %{pkgnamepatch}-logrotate.patch Patch5: %{pkgnamepatch}-file-contents.patch Patch7: %{pkgnamepatch}-scripts.patch -Patch8: %{pkgnamepatch}-install-db-sharedir.patch Patch9: %{pkgnamepatch}-ownsetup.patch Patch10: %{pkgnamepatch}-noclientlib.patch Patch12: %{pkgnamepatch}-admincrash.patch @@ -231,9 +221,9 @@ Patch37: %{pkgnamepatch}-notestdb.patch Patch38: %{pkgnamepatch}-servicename.patch # Patches for galera -Patch40: %{pkgnamepatch}-galera.cnf.patch Patch42: %{pkgnamepatch}-galera-new-cluster-init.patch Patch43: %{pkgnamepatch}-galera-macros.patch +Patch44: %{pkgnamepatch}-recoverpath.patch # Patches specific for scl Patch90: %{pkgnamepatch}-scl-env-check.patch @@ -730,24 +720,27 @@ MariaDB is a community developed branch of MySQL. # Removt JAR files that upstream puts into tarball find . -name "*.jar" -type f -exec rm --verbose -f {} \; +# strmov - check upstream ticket %patch1 -p1 -%patch2 -p1 + %patch4 -p1 %patch5 -p1 %patch7 -p1 -%patch8 -p1 %patch9 -p1 %patch10 -p1 %patch12 -p1 %patch30 -p1 %patch37 -p1 %patch38 -p1 -%patch40 -p1 %if %{without init_systemd} %patch42 -p1 %endif + +# galera-macros - check sbindir vs libexecdir %patch43 -p1 +%patch44 -p1 + # workaround for upstream bug #56342 rm mysql-test/t/ssl_8k_key-master.opt @@ -868,6 +861,7 @@ export LDFLAGS -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" \ -DENABLED_LOCAL_INFILE=ON \ @@ -927,6 +921,9 @@ ln -s mysql_config.1.gz %{buildroot}%{_mandir}/man1/mariadb_config.1.gz mkdir -p %{buildroot}/%{_libdir}/pkgconfig mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig +mv %{buildroot}/%{_libdir}/pkgconfig/mariadb.pc %{buildroot}/%{_libdir}/pkgconfig/%{?scl_prefix}mariadb.pc +mv %{buildroot}/%{_libdir}/pkgconfig/libmariadb.pc %{buildroot}/%{_libdir}/pkgconfig/%{?scl_prefix}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}/mysql/ @@ -953,10 +950,18 @@ rm %{buildroot}%{_sysconfdir}/my.cnf # use different config file name for each variant of server mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf +%if %{with init_systemd} +# Rename sysusers and tmpfiles config files, they should be named after the software they belong to +mv %{buildroot}/usr/lib/sysusers.d/sysusers.conf %{buildroot}/usr/lib/sysusers.d/%{name}.conf +%endif + # install systemd unit files and scripts for handling server startup %if %{with init_systemd} 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}/usr/lib/tmpfiles.d/tmpfiles.conf +# Install downstream version install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf %endif @@ -991,6 +996,7 @@ ln -s ../../../../../bin/my_safe_process %{buildroot}%{_datadir}/mysql-test/lib/ # should move this to /etc/ ? rm %{buildroot}%{_bindir}/mysql_embedded +rm %{buildroot}%{_mandir}/man1/mysql_embedded* rm %{buildroot}%{_libdir}/mysql/*.a rm %{buildroot}%{_datadir}/%{pkg_name}/binary-configure rm %{buildroot}%{_datadir}/%{pkg_name}/magic @@ -1080,7 +1086,8 @@ unlink %{buildroot}%{_bindir}/mysql_config rm %{buildroot}%{_bindir}/mariadb_config rm -r %{buildroot}%{_includedir}/mysql rm %{buildroot}%{_datadir}/aclocal/mysql.m4 -rm %{buildroot}%{_libdir}/pkgconfig/mariadb.pc +rm %{buildroot}%{_libdir}/pkgconfig/%{?scl_prefix}mariadb.pc +rm %{buildroot}%{_libdir}/pkgconfig/%{?scl_prefix}libmariadb.pc rm %{buildroot}%{_mandir}/man1/mysql_config.1* unlink %{buildroot}%{_mandir}/man1/mariadb_config.1* %endif @@ -1116,7 +1123,7 @@ rm %{buildroot}%{_bindir}/tokuft_logprint %endif # because upstream ships manpages for tokudb even on architectures that tokudb doesn't support rm %{buildroot}%{_mandir}/man1/tokuftdump.1* -rm %{buildroot}%{_mandir}/man1/tokuft_logdump.1* +rm %{buildroot}%{_mandir}/man1/tokuft_logprint.1* %endif %if %{without config} @@ -1145,6 +1152,10 @@ rm -r %{buildroot}%{_datadir}/mysql-test rm %{buildroot}%{_mandir}/man1/mysql_client_test.1* %endif +%if %{without rocksdb} +rm %{buildroot}%{_mandir}/man1/mysql_ldb.1* +%endif + %if 0%{?scl:1} # generate a configuration file for daemon cat << EOF | tee -a %{buildroot}%{?_scl_scripts}/service-environment @@ -1181,16 +1192,20 @@ aria_read_log innochecksum myisam_ftdump myisamchk myisamlog myisampack mysql_install_db mysql_secure_installation mysql_tzinfo_to_sql mysql_upgrade mysqld_safe mysqld_safe_helper replace resolve_stack_dump resolveip wsrep_sst_common wsrep_sst_mysqldump wsrep_sst_rsync -wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2' +wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 wsrep_sst_rsync_wan' + -mariadb_backup_binaries_no_man='wsrep_sst_mariabackup mariabackup mbstream' +mariadb_backup_binaries='wsrep_sst_mariabackup mariabackup mbstream' %scl_syspaths_install_wrappers -n mariadb-server -m script -p bin $mariadb_server_binaries -%scl_syspaths_install_wrappers -n mariadb-backup -m script -p bin $mariadb_backup_binaries_no_man +%scl_syspaths_install_wrappers -n mariadb-backup -m script -p bin $mariadb_backup_binaries mans= ; for bin in $mariadb_server_binaries; do mans+=" man1/$bin.1.gz" ; done %scl_syspaths_install_wrappers -n mariadb-server -m link -p man $mans +mans= ; for bin in $mariadb_backup_binaries; do mans+=" man1/$bin.1.gz" ; done +%scl_syspaths_install_wrappers -n mariadb-backup -m link -p man $mans + %scl_syspaths_install_wrapper -n mariadb-server -m link %{logfiledir} %{_root_localstatedir}/log/%{scl_prefix}mariadb %scl_syspaths_install_wrapper -n mariadb-server -m link %{dbdatadir} %{_root_localstatedir}/lib/%{scl_prefix}mysql @@ -1492,6 +1507,7 @@ fi %{_bindir}/wsrep_sst_mariabackup %{_bindir}/wsrep_sst_mysqldump %{_bindir}/wsrep_sst_rsync +%{_bindir}/wsrep_sst_rsync_wan %{_bindir}/wsrep_sst_xtrabackup %{_bindir}/wsrep_sst_xtrabackup-v2 %{?with_tokudb:%{_bindir}/tokuftdump} @@ -1505,6 +1521,7 @@ fi %config(noreplace) %{_sysconfdir}/my.cnf.d/rocksdb.cnf %{_bindir}/mysql_ldb %{_bindir}/sst_dump +%{_mandir}/man1/mysql_ldb.1* %endif %{_libexecdir}/mysqld @@ -1550,10 +1567,12 @@ fi %{_mandir}/man1/resolve_stack_dump.1* %{_mandir}/man8/mysqld.8* %{?with_tokudb:%{_mandir}/man1/tokuftdump.1*} -%{?with_tokudb:%{_mandir}/man1/tokuft_logdump.1*} +%{?with_tokudb:%{_mandir}/man1/tokuft_logprint.1*} %{_mandir}/man1/wsrep_sst_common.1* +%{_mandir}/man1/wsrep_sst_mariabackup.1* %{_mandir}/man1/wsrep_sst_mysqldump.1* %{_mandir}/man1/wsrep_sst_rsync.1* +%{_mandir}/man1/wsrep_sst_rsync_wan.1* %{_mandir}/man1/wsrep_sst_xtrabackup.1* %{_mandir}/man1/wsrep_sst_xtrabackup-v2.1* @@ -1586,6 +1605,7 @@ fi %endif %{?with_init_systemd:%{_tmpfilesdir}/%{name}.conf} +%{?with_init_systemd:%{_sysusersdir}/%{name}.conf} %attr(0755,mysql,mysql) %dir %{pidfiledir} %attr(0755,mysql,mysql) %dir %{dbdatadir} %{?scl:%attr(0755,mysql,mysql) %dir /var/lib/mysql} @@ -1611,6 +1631,8 @@ fi %files backup %{_bindir}/mariabackup %{_bindir}/mbstream +%{_mandir}/man1/mariabackup.1* +%{_mandir}/man1/mbstream.1* %endif %if %{with cracklib_password_check} @@ -1655,7 +1677,8 @@ fi %{_bindir}/mariadb_config* %{_includedir}/mysql %{_datadir}/aclocal/mysql.m4 -%{_libdir}/pkgconfig/mariadb.pc +%{_libdir}/pkgconfig/%{?scl_prefix}mariadb.pc +%{_libdir}/pkgconfig/%{?scl_prefix}libmariadb.pc %if %{with clibrary} %{_libdir}/mysql/libmariadb.so %{_libdir}/mysql/libmysqlclient.so @@ -1698,7 +1721,38 @@ fi %scl_syspaths_files -n mariadb-server-utils %scl_syspaths_files -n mariadb-server-galera %endif + %changelog +* Mon Sep 10 2018 Michal Schorm - 1:10.2.22-1 +- Rebase to 10.2.22 + Resolves: #1510416 + Resolves: #1645934 +- Use downstream tmpfiles instead of the upstream one +- Patch 2 upstreamed +- Patch 8 obsolete - upstream started to use macros +- Patch 40 upstreamed +- Add patch for wsrep_recover_position function in mysqld_safe + Resolves: #1694679 +- CVEs fixed: #1664048 + CVE-2018-3200 CVE-2018-3284 CVE-2018-3173 CVE-2018-3162 CVE-2018-3156 + CVE-2018-3282 CVE-2018-3277 CVE-2018-3143 CVE-2018-3251 CVE-2018-3185 +- CVEs fixed: #1617946 + CVE-2018-3058 CVE-2018-3060 CVE-2018-3063 CVE-2018-3064 CVE-2018-3066 +- CVEs fixed: #1572138 + CVE-2018-2755 CVE-2018-2759 CVE-2018-2761 CVE-2018-2766 CVE-2018-2771 + CVE-2018-2777 CVE-2018-2781 CVE-2018-2782 CVE-2018-2784 CVE-2018-2786 + CVE-2018-2787 CVE-2018-2810 CVE-2018-2813 CVE-2018-2817 CVE-2018-2819 + CVE-2018-3081 +- CVEs fixed: #1559064 + CVE-2018-2562 CVE-2018-2612 CVE-2018-2622 CVE-2018-2640 CVE-2018-2665 + CVE-2018-2668 CVE-2018-3133 +- CVEs fixed: #1558264 + CVE-2017-15365 +- CVEs fixed: #1558261 + CVE-2017-10268 CVE-2017-10378 +- CVEs fixed: #1640321 + CVE-2018-3174 + * Sun Sep 24 2017 Honza Horak - 1:10.2.8-5 - Support MYSQLD_OPTS and _WSREP_NEW_CLUSTER env vars in init script, same as it is done in case of systemd unit file