From edac62c8244316d930e51ec12a475b82e1e03870 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 24 Mar 2012 08:49:47 +0100 Subject: MySQL, sync with rawhide --- mysql-logrotate.patch | 60 +++++++++++++++++++++++++++++++++++++-------- mysql-plugin-test.patch | 8 ++++++ mysql-string-overflow.patch | 3 +++ mysql55.spec | 23 ++++++++++++++++- mysqld.service | 6 +++++ 5 files changed, 89 insertions(+), 11 deletions(-) diff --git a/mysql-logrotate.patch b/mysql-logrotate.patch index dd8742a..8ad9d2c 100644 --- a/mysql-logrotate.patch +++ b/mysql-logrotate.patch @@ -1,10 +1,21 @@ -Adjust the mysql-log-rotate script to contain the correct log file -name for Red Hat installations. +Adjust the mysql-log-rotate script in several ways: +* Use the correct log file pathname for Red Hat installations. +* Enable creation of the log file by logrotate (needed since + /var/log/ isn't writable by mysql user). +* Comment out the actual rotation commands, so that user must edit + the file to enable rotation. This is unfortunate, but the fact + that the script will probably fail without manual configuration + (to set a root password) means that we can't really have it turned + on by default. Fortunately, in most configurations the log file + is low-volume and so rotation is not critical functionality. -diff -Naur mysql-5.5.20.orig/support-files/mysql-log-rotate.sh mysql-5.5.20/support-files/mysql-log-rotate.sh ---- mysql-5.5.20.orig/support-files/mysql-log-rotate.sh 2011-12-16 14:52:06.000000000 -0500 -+++ mysql-5.5.20/support-files/mysql-log-rotate.sh 2012-01-26 23:24:54.402676177 -0500 +See discussions at RH bugs 799735, 547007 + + +diff -Naur mysql-5.5.22.orig/support-files/mysql-log-rotate.sh mysql-5.5.22/support-files/mysql-log-rotate.sh +--- mysql-5.5.22.orig/support-files/mysql-log-rotate.sh 2012-03-02 14:44:46.000000000 -0500 ++++ mysql-5.5.22/support-files/mysql-log-rotate.sh 2012-03-23 22:33:29.092043705 -0400 @@ -3,7 +3,7 @@ # in the [safe_mysqld] section as follows: # @@ -14,12 +25,41 @@ diff -Naur mysql-5.5.20.orig/support-files/mysql-log-rotate.sh mysql-5.5.20/supp # # If the root user has a password you have to create a # /root/.my.cnf configuration file with the following -@@ -18,7 +18,7 @@ +@@ -18,19 +18,21 @@ # ATTENTION: This /root/.my.cnf should be readable ONLY # for root ! -@localstatedir@/mysqld.log { -+/var/log/mysqld.log { - # create 600 mysql mysql - notifempty - daily +- # create 600 mysql mysql +- notifempty +- daily +- rotate 3 +- missingok +- compress +- postrotate +- # just if mysqld is really running +- if test -x @bindir@/mysqladmin && \ +- @bindir@/mysqladmin ping &>/dev/null +- then +- @bindir@/mysqladmin flush-logs +- fi +- endscript +-} ++# Then, un-comment the following lines to enable rotation of mysql's log file: ++ ++#/var/log/mysqld.log { ++# create 600 mysql mysql ++# notifempty ++# daily ++# rotate 3 ++# missingok ++# compress ++# postrotate ++# # just if mysqld is really running ++# if test -x @bindir@/mysqladmin && \ ++# @bindir@/mysqladmin ping &>/dev/null ++# then ++# @bindir@/mysqladmin flush-logs ++# fi ++# endscript ++#} diff --git a/mysql-plugin-test.patch b/mysql-plugin-test.patch index 51c8328..5d08c32 100644 --- a/mysql-plugin-test.patch +++ b/mysql-plugin-test.patch @@ -1,3 +1,11 @@ +mysql_plugin.test fails when run in mysql-test RPM, though the build-time +regression test is OK. This patch is from the pre-existing upstream bug +report, except we also fix the part that tries to scribble on the +read-only-to-us plugin directory. + +rhbz #789530, upstream at http://bugs.mysql.com/bug.php?id=62907 + + diff -up mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt --- mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin 2012-01-31 12:28:15.000000000 +0100 +++ mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt 2012-03-14 16:54:19.060951822 +0100 diff --git a/mysql-string-overflow.patch b/mysql-string-overflow.patch index 80cf5bc..f86d3b9 100644 --- a/mysql-string-overflow.patch +++ b/mysql-string-overflow.patch @@ -1,6 +1,9 @@ These issues were found by Coverity static analysis tool, for more info see messages by particular fixes (messages belong to 5.1.61). +Filed upstream at http://bugs.mysql.com/bug.php?id=64631 + + Error: BUFFER_SIZE_WARNING: /builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated. diff --git a/mysql55.spec b/mysql55.spec index 5e54739..045cfd1 100644 --- a/mysql55.spec +++ b/mysql55.spec @@ -1,6 +1,6 @@ Name: mysql Version: 5.5.22 -Release: 1%{?dist} +Release: 1%{?dist}.1 Summary: MySQL client programs and shared libraries Group: Applications/Databases @@ -428,11 +428,18 @@ install -m 0755 -d $RPM_BUILD_ROOT/var/lib/mysql mkdir -p $RPM_BUILD_ROOT/etc install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/my.cnf +%if 0%{?fedora} >= 15 +sed -i -e '/user=mysql/d' $RPM_BUILD_ROOT/etc/my.cnf +%endif %if 0%{?fedora} >= 15 # install systemd unit files and scripts for handling server startup mkdir -p ${RPM_BUILD_ROOT}%{_unitdir} install -m 644 %{SOURCE11} ${RPM_BUILD_ROOT}%{_unitdir}/ +%if 0%{?fedora} == 15 +# PrivateTmp only work on fedora >= 16 +sed -i -e '/PrivateTmp/s/true/false/' ${RPM_BUILD_ROOT}%{_unitdir}/mysqld.service +%endif install -m 755 %{SOURCE12} ${RPM_BUILD_ROOT}%{_libexecdir}/ install -m 755 %{SOURCE13} ${RPM_BUILD_ROOT}%{_libexecdir}/ @@ -796,6 +803,20 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Sat Mar 24 2012 Remi Collet - 5.5.22-1.1 +- sync patches with rawhide + +* Sat Mar 24 2012 Tom Lane 5.5.22-1 +- Update to MySQL 5.5.22, for various fixes described at + http://dev.mysql.com/doc/refman/5.5/en/news-5-5-22.html +- Turn on PrivateTmp in service file +Resolves: #782513 +- Comment out the contents of /etc/logrotate.d/mysqld, so that manual + action is needed to enable log rotation. Given the multiple ways in + which the rotation script can fail, it seems imprudent to try to make + it run by default. +Resolves: #799735 + * Fri Mar 23 2012 Remi Collet - 5.5.22-1 - update to MySQL 5.5.22 Community Server GA http://dev.mysql.com/doc/refman/5.5/en/news-5-5-22.html diff --git a/mysqld.service b/mysqld.service index b7fa095..7289f9d 100644 --- a/mysqld.service +++ b/mysqld.service @@ -14,6 +14,9 @@ # [Service] # LimitNOFILE=10000 +# Note: in F-17 and beyond, /usr/lib/... is recommended in the .include line +# though /lib/... will still work. + [Unit] Description=MySQL database server After=syslog.target @@ -36,5 +39,8 @@ TimeoutSec=300 # We rely on systemd, not mysqld_safe, to restart mysqld if it dies Restart=always +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + [Install] WantedBy=multi-user.target -- cgit