Upgrade to 5.7.34 version

This commit is contained in:
houyingchao 2022-02-25 14:22:16 +08:00
parent 43a85f7dbf
commit 83a248c84d
4 changed files with 49 additions and 60 deletions

View File

@ -1,8 +1,32 @@
Do not assume, that "crypt" function is provided by glibc; #1536881
--- mysql-5.7.21/include/my_global.h 2017-12-28 04:46:26.000000000 +0100
+++ mysql-5.7.21/include/my_global.h_patched 2018-01-22 01:01:42.450315852 +0100
@@ -49,6 +49,9 @@
diff -Naur mysql-5.7.34_orig/config.h.cmake mysql-5.7.34_patched/config.h.cmake
--- mysql-5.7.34_orig/config.h.cmake 2021-06-24 11:17:47.697396007 +0800
+++ mysql-5.7.34_patched/config.h.cmake 2021-06-24 11:44:15.405418497 +0800
@@ -69,6 +69,7 @@
#cmakedefine HAVE_FNMATCH_H 1
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_SASL_SASL_H 1
+#cmakedefine HAVE_CRYPT_H 1
/* Libevent */
#cmakedefine HAVE_DEVPOLL 1
diff -Naur mysql-5.7.34_orig/configure.cmake mysql-5.7.34_patched/configure.cmake
--- mysql-5.7.34_orig/configure.cmake 2021-06-24 11:17:47.697396007 +0800
+++ mysql-5.7.34_patched/configure.cmake 2021-06-24 11:43:24.612905857 +0800
@@ -252,6 +252,7 @@
CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H) # Used by NDB/libevent
CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H)
CHECK_INCLUDE_FILES (sys/un.h HAVE_SYS_UN_H)
+CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
# For libevent
CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_DEVPOLL)
diff -Naur mysql-5.7.34_orig/include/my_global.h mysql-5.7.34_patched/include/my_global.h
--- mysql-5.7.34_orig/include/my_global.h 2021-06-24 11:17:47.721396249 +0800
+++ mysql-5.7.34_patched/include/my_global.h 2021-06-24 11:41:58.240034110 +0800
@@ -61,6 +61,9 @@
#include <time.h>
#include <errno.h> /* Recommended by debian */
#include <sys/types.h>
@ -12,27 +36,3 @@ Do not assume, that "crypt" function is provided by glibc; #1536881
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
--- mysql-5.7.21/configure.cmake 2017-12-28 04:46:26.000000000 +0100
+++ mysql-5.7.21/configure.cmake_patched 2018-01-22 01:00:09.955057755 +0100
@@ -493,6 +493,7 @@ CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMA
CHECK_INCLUDE_FILES (sys/un.h HAVE_SYS_UN_H)
CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H) # Used by libedit
CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_SASL_H) # Used by memcached
+CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
# For libevent
CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_DEVPOLL)
--- mysql-5.7.21/config.h.cmake 2017-12-28 04:46:26.000000000 +0100
+++ mysql-5.7.21/config.h.cmake_patched 2018-01-22 01:51:02.522570765 +0100
@@ -62,6 +62,7 @@
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_VIS_H 1
#cmakedefine HAVE_SASL_SASL_H 1
+#cmakedefine HAVE_CRYPT_H 1
/* Libevent */
#cmakedefine HAVE_DEVPOLL 1

View File

@ -18,14 +18,10 @@ http://bugs.mysql.com/bug.php?id=83696
https://jira.mariadb.org/browse/MDEV-7788
diff -Naurp mysql-5.7.18_original/mysys_ssl/my_md5.cc mysql-5.7.18_patched/mysys_ssl/my_md5.cc
--- mysql-5.7.18_original/mysys_ssl/my_md5.cc 2017-03-18 08:45:14.000000000 +0100
+++ mysql-5.7.18_patched/mysys_ssl/my_md5.cc 2017-05-12 12:19:38.584814619 +0200
@@ -38,13 +38,22 @@ static void my_md5_hash(char *digest, co
#elif defined(HAVE_OPENSSL)
#include <openssl/md5.h>
+#include <openssl/evp.h>
diff -Naurp mysql-5.7.34_original/mysys_ssl/my_md5.cc mysql-5.7.34_patched/mysys_ssl/my_md5.cc
--- mysql-5.7.34_original/mysys_ssl/my_md5.cc 2017-03-18 08:45:14.000000000 +0100
+++ mysql-5.7.34_patched/mysys_ssl/my_md5.cc 2017-05-12 12:19:38.584814619 +0200
@@ -41,10 +41,18 @@
static void my_md5_hash(unsigned char* digest, unsigned const char *buf, int len)
{
@ -47,4 +43,4 @@ diff -Naurp mysql-5.7.18_original/mysys_ssl/my_md5.cc mysql-5.7.18_patched/mysys
+ EVP_MD_CTX_destroy(ctx);
}
#endif /* HAVE_YASSL */
#endif /* HAVE_OPENSSL */

View File

@ -1,5 +1,11 @@
%global pkg_name %{name}
%global pkgnamepatch mysql5
# The reason of introduce this is:
# openEuler/gcc version bump so quick. So any new gcc version might default disable
# some options which are default to enable in previos gcc versions.
%global gcc_c_adaptive_options -fcommon
%{!?runselftest:%global runselftest 1}
%global check_testsuite 0
%global with_shared_lib_major_hack 0
@ -32,11 +38,11 @@
%bcond_without conflicts
%global sameevr %{?epoch:%{epoch}:}%{version}-%{release}
Name: mysql5
Version: 5.7.21
Release: 4
Version: 5.7.34
Release: 2
Summary: MySQL client programs and shared libraries
URL: http://www.mysql.com
License: GPLv2 and LGPLv2 and BSD
License: GPLv2 with exceptions and LGPLv2 and BSD
Source0: https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-%{version}.tar.gz
Source2: mysql_config_multilib.sh
Source3: my.cnf.in
@ -58,12 +64,8 @@ Patch3: %{pkgnamepatch}-logrotate.patch
Patch4: %{pkgnamepatch}-file-contents.patch
Patch5: %{pkgnamepatch}-scripts.patch
Patch6: %{pkgnamepatch}-paths.patch
Patch7: %{pkgnamepatch}-md5_fips.patch
Patch51: %{pkgnamepatch}-chain-certs.patch
Patch52: %{pkgnamepatch}-sharedir.patch
Patch70: %{pkgnamepatch}-5.7.9-major.patch
Patch71: %{pkgnamepatch}-openssl11.patch
Patch72: %{pkgnamepatch}-tirpc.patch
Patch73: %{pkgnamepatch}-libxcrypt.patch
Patch74: fix-innodb.innodb-fail-on-aarch64.patch
Patch75: fix_grant_user_lock_as_root.patch
@ -81,7 +83,7 @@ BuildRequires: systemtap-sdt-devel zlib-devel multilib-rpm-config procps t
BuildRequires: perl(Digest::file) perl(Digest::MD5) perl(Env) perl(Exporter) perl(Fcntl)
BuildRequires: perl(File::Temp) perl(Data::Dumper) perl(Getopt::Long) perl(IPC::Open3)
BuildRequires: perl(JSON) perl(Memoize) perl(Socket) perl(Sys::Hostname) perl(Test::More)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(Time::HiRes) vim git grep
%{?with_init_systemd:BuildRequires: systemd}
Requires: bash coreutils grep %{name}-common = %{sameevr}
Provides: bundled(boost) = 1.59
@ -238,14 +240,11 @@ the MySQL sources.
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch51 -p1
#%patch7 -p1
%patch52 -p1
%if %{with_shared_lib_major_hack}
%patch70 -p1
%endif
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
@ -350,7 +349,7 @@ cmake .. \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_BOOST=../boost \
-DCMAKE_C_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \
-DCMAKE_C_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable} %{gcc_c_adaptive_options}" \
-DCMAKE_CXX_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \
%{?with_debug: -DWITH_DEBUG=1}\
-DTMPDIR=/var/tmp \
@ -400,8 +399,6 @@ rm %{buildroot}%{_datadir}/%{pkg_name}/magic
rm %{buildroot}%{_datadir}/%{pkg_name}/mysql.server
rm %{buildroot}%{_datadir}/%{pkg_name}/mysqld_multi.server
rm %{buildroot}%{_mandir}/man1/comp_err.1*
rm %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1*
rm %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1*
mkdir -p %{buildroot}%{logrotateddir}
mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name}
chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name}
@ -413,9 +410,6 @@ mv %{buildroot}%{_libexecdir}/mysqld-debug %{buildroot}%{_libexecdir}/mysqld
popd
install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}}
install -p -m 0644 mysql-test/%{skiplist} %{buildroot}%{_datadir}/mysql-test
rm %{buildroot}%{_mandir}/man1/{mysqltest,mysql_client_test}_embedded.1
cp -p %{buildroot}%{_mandir}/man1/mysqltest.1 %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
cp -p %{buildroot}%{_mandir}/man1/mysql_client_test.1 %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
%if %{without clibrary}
unlink %{buildroot}%{_libdir}/mysql/libmysqlclient.so
rm -r %{buildroot}%{_libdir}/mysql/libmysqlclient*.so.*
@ -471,7 +465,6 @@ cp ../../mysql-test/%{skiplist} .
export MTR_BUILD_THREAD=%{__isa_bits}
./mtr \
--mem --parallel=auto --force --retry=2 \
--mysqld=--binlog-format=mixed \
--suite-timeout=720 --testcase-timeout=30 \
--report-unstable-tests --clean-vardir \
%if %{check_testsuite}
@ -576,7 +569,7 @@ fi
%if %{with common}
%files common
%doc README COPYING README.mysql-license
%doc README README.mysql-license LICENSE
%doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google
%dir %{_libdir}/mysql
%dir %{_datadir}/%{pkg_name}
@ -730,13 +723,13 @@ fi
%{_bindir}/mysqlxtest
%{_bindir}/my_safe_process
%attr(-,mysql,mysql) %{_datadir}/mysql-test
%{_mandir}/man1/mysqltest.1*
%{_mandir}/man1/mysqltest_embedded.1*
%{_mandir}/man1/mysql_client_test.1*
%{_mandir}/man1/mysql_client_test_embedded.1*
%endif
%changelog
* Fri Feb 25 2022 houyingchao <houyingchao@huawei.com> - 5.7.34-2
- Upgrade to 5.7.34 version
- Fix CVES
* Tue Nov 30 2021 wulei <wulei80@huawei.com> - 5.7.21-4
- Fix innodb.innodb fail on aarch64
- Fix grant_user_lock as root