[mysql] Update to MySQL 5.5.28; assorted minor packaging fixes
Tom Lane
tgl at fedoraproject.org
Sat Sep 29 19:58:09 UTC 2012
commit becf15201cfdab8f3c91d4f2f6837bbc5242851e
Author: Tom Lane <tgl at redhat.com>
Date: Sat Sep 29 15:57:43 2012 -0400
Update to MySQL 5.5.28; assorted minor packaging fixes
.gitignore | 2 +-
libmysql.version | 3 +++
mysql-chain-certs.patch | 32 ++++++++++++++++----------------
mysql-openssl-test.patch | 22 ----------------------
mysql.spec | 30 +++++++++++++++++++++++++++---
mysqld-prepare-db-dir | 29 +++++++++++++++++++++++++----
mysqld-wait-ready | 2 +-
mysqld.service | 2 +-
sources | 2 +-
9 files changed, 75 insertions(+), 49 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 658f35a..d54f41e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/mysql-5.5.27-nodocs.tar.gz
+/mysql-5.5.28-nodocs.tar.gz
diff --git a/libmysql.version b/libmysql.version
index dc32cd7..d547b5d 100644
--- a/libmysql.version
+++ b/libmysql.version
@@ -117,6 +117,9 @@ libmysqlclient_16 {
# de-facto API as well. We're not going to export the deprecated version
# make_scrambled_password, however.
my_make_scrambled_password;
+# This really shouldn't be exported, but some applications use it as a
+# workaround for inadequate threading support; see bug #846602
+ THR_KEY_mysys;
local:
*;
};
diff --git a/mysql-chain-certs.patch b/mysql-chain-certs.patch
index 3b20a28..164c22e 100644
--- a/mysql-chain-certs.patch
+++ b/mysql-chain-certs.patch
@@ -10,22 +10,10 @@ Fedora builds, I'm not feeling motivated to try to fix yassl for this.
See RH bug #598656. Filed upstream at http://bugs.mysql.com/bug.php?id=54158
-diff -Naur mysql-5.1.47.orig/vio/viosslfactories.c mysql-5.1.47/vio/viosslfactories.c
---- mysql-5.1.47.orig/vio/viosslfactories.c 2010-05-06 11:28:07.000000000 -0400
-+++ mysql-5.1.47/vio/viosslfactories.c 2010-05-26 23:23:46.000000000 -0400
-@@ -100,7 +100,7 @@
- (long) ctx, cert_file, key_file));
- if (cert_file)
- {
-- if (SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
-+ if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
- {
- *error= SSL_INITERR_CERT;
- DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
-diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/src/ssl.cpp
---- mysql-5.1.47.orig/extra/yassl/src/ssl.cpp 2010-05-06 11:24:26.000000000 -0400
-+++ mysql-5.1.47/extra/yassl/src/ssl.cpp 2010-05-26 23:29:13.000000000 -0400
-@@ -1606,10 +1606,10 @@
+diff -Naur mysql-5.5.28.orig/extra/yassl/src/ssl.cpp mysql-5.5.28/extra/yassl/src/ssl.cpp
+--- mysql-5.5.28.orig/extra/yassl/src/ssl.cpp 2012-08-29 04:50:46.000000000 -0400
++++ mysql-5.5.28/extra/yassl/src/ssl.cpp 2012-09-29 12:45:19.682287214 -0400
+@@ -1627,10 +1627,10 @@
}
@@ -39,3 +27,15 @@ diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/sr
}
+diff -Naur mysql-5.5.28.orig/vio/viosslfactories.c mysql-5.5.28/vio/viosslfactories.c
+--- mysql-5.5.28.orig/vio/viosslfactories.c 2012-08-29 04:50:46.000000000 -0400
++++ mysql-5.5.28/vio/viosslfactories.c 2012-09-29 12:46:35.124975585 -0400
+@@ -106,7 +106,7 @@
+ key_file= cert_file;
+
+ if (cert_file &&
+- SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
++ SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
+ {
+ *error= SSL_INITERR_CERT;
+ DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
diff --git a/mysql.spec b/mysql.spec
index 121f96b..dff5a8e 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -1,5 +1,5 @@
Name: mysql
-Version: 5.5.27
+Version: 5.5.28
Release: 1%{?dist}
Summary: MySQL client programs and shared libraries
@@ -48,7 +48,6 @@ Patch7: mysql-versioning.patch
Patch8: mysql-dubious-exports.patch
Patch10: mysql-plugin-bool.patch
Patch11: mysql-s390-tsc.patch
-Patch12: mysql-openssl-test.patch
Patch14: mysql-va-list.patch
Patch15: mysql-netdevname.patch
Patch16: mysql-logrotate.patch
@@ -203,7 +202,6 @@ the MySQL sources.
%patch8 -p1
%patch10 -p1
%patch11 -p1
-%patch12 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
@@ -459,10 +457,14 @@ rm -rf $RPM_BUILD_ROOT
/sbin/ldconfig
%post server
+%if 0%{?systemd_post:1}
+%systemd_post mysqld.service
+%else
if [ $1 = 1 ]; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
+%endif
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
@@ -482,11 +484,15 @@ if [ -f /etc/rc.d/init.d/mysqld ]; then
fi
%preun server
+%if 0%{?systemd_preun:1}
+%systemd_preun mysqld.service
+%else
if [ $1 = 0 ]; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable mysqld.service >/dev/null 2>&1 || :
/bin/systemctl stop mysqld.service >/dev/null 2>&1 || :
fi
+%endif
%postun libs
if [ $1 = 0 ] ; then
@@ -494,11 +500,15 @@ if [ $1 = 0 ] ; then
fi
%postun server
+%if 0%{?systemd_postun_with_restart:1}
+%systemd_postun_with_restart mysqld.service
+%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then
# Package upgrade, not uninstall
/bin/systemctl try-restart mysqld.service >/dev/null 2>&1 || :
fi
+%endif
%files
@@ -691,6 +701,20 @@ fi
%{_mandir}/man1/mysql_client_test.1*
%changelog
+* Sat Sep 29 2012 Tom Lane <tgl at redhat.com> 5.5.28-1
+- Update to MySQL 5.5.28, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.5/en/news-5-5-28.html
+- Clean up partially-created database files when mysql_install_db fails
+Related: #835131
+- Honor user and group settings from service file in mysqld-prepare-db-dir
+Resolves: #840431
+- Export THR_KEY_mysys as a workaround for inadequate threading support
+Resolves: #846602
+- Adopt new systemd macros for server package install/uninstall triggers
+Resolves: #850222
+- Use --no-defaults when invoking mysqladmin to wait for the server to start
+Related: #855704
+
* Sun Aug 5 2012 Tom Lane <tgl at redhat.com> 5.5.27-1
- Update to MySQL 5.5.27, for various fixes described at
http://dev.mysql.com/doc/refman/5.5/en/news-5-5-27.html
diff --git a/mysqld-prepare-db-dir b/mysqld-prepare-db-dir
index 78c0bd7..f73bc66 100644
--- a/mysqld-prepare-db-dir
+++ b/mysqld-prepare-db-dir
@@ -22,10 +22,31 @@ datadir="$result"
get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
errlogfile="$result"
+# Absorb configuration settings from the specified systemd service file,
+# or the default "mysqld" service if not specified
+SERVICE_NAME="$1"
+if [ x"$SERVICE_NAME" = x ]
+then
+ SERVICE_NAME=mysqld.service
+fi
+
+myuser=`systemctl show -p User "${SERVICE_NAME}" |
+ sed 's/^User=//'`
+if [ x"$myuser" = x ]
+then
+ myuser=mysql
+fi
+
+mygroup=`systemctl show -p Group "${SERVICE_NAME}" |
+ sed 's/^Group=//'`
+if [ x"$mygroup" = x ]
+then
+ mygroup=mysql
+fi
# Set up the errlogfile with appropriate permissions
touch "$errlogfile"
-chown mysql:mysql "$errlogfile"
+chown "$myuser:$mygroup" "$errlogfile"
chmod 0640 "$errlogfile"
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
@@ -37,13 +58,13 @@ if [ ! -d "$datadir/mysql" ] ; then
then
mkdir -p "$datadir" || exit 1
fi
- chown mysql:mysql "$datadir"
+ chown "$myuser:$mygroup" "$datadir"
chmod 0755 "$datadir"
[ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
# Now create the database
echo "Initializing MySQL database"
- /usr/bin/mysql_install_db --datadir="$datadir" --user=mysql
+ /usr/bin/mysql_install_db --datadir="$datadir" --user="$myuser"
ret=$?
if [ $ret -ne 0 ] ; then
echo "Initialization of MySQL database failed." >&2
@@ -55,7 +76,7 @@ if [ ! -d "$datadir/mysql" ] ; then
exit $ret
fi
# In case we're running as root, make sure files are owned properly
- chown -R mysql:mysql "$datadir"
+ chown -R "$myuser:$mygroup" "$datadir"
fi
exit 0
diff --git a/mysqld-wait-ready b/mysqld-wait-ready
index 8fe99ec..9b0fd0c 100644
--- a/mysqld-wait-ready
+++ b/mysqld-wait-ready
@@ -31,7 +31,7 @@ socketfile="$result"
# Wait for the server to come up or for the mysqld process to disappear
ret=0
while /bin/true; do
- RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
+ RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
mret=$?
if [ $mret -eq 0 ]; then
break
diff --git a/mysqld.service b/mysqld.service
index c6e4dea..3193ce2 100644
--- a/mysqld.service
+++ b/mysqld.service
@@ -27,7 +27,7 @@ Type=simple
User=mysql
Group=mysql
-ExecStartPre=/usr/libexec/mysqld-prepare-db-dir
+ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=/usr/bin/mysqld_safe --basedir=/usr
diff --git a/sources b/sources
index ca44937..0e73348 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-fc115ac6b28412298886651cffc70ccf mysql-5.5.27-nodocs.tar.gz
+88d39960d3f348836f803aca091ee601 mysql-5.5.28-nodocs.tar.gz
More information about the scm-commits
mailing list