From b11940014243d707dc2a856f8e424d4fe555f184 Mon Sep 17 00:00:00 2001 From: mgb01105731 Date: Wed, 15 May 2024 10:42:25 +0800 Subject: [PATCH] update to 8.0.37 --- add-loongarch64-support-for-mysql.patch | 12 +-- download | 2 +- mysql-mtr.patch | 10 ++- mysql.spec | 11 ++- revert-be8348a7.patch | 106 ++++++++---------------- 5 files changed, 53 insertions(+), 88 deletions(-) diff --git a/add-loongarch64-support-for-mysql.patch b/add-loongarch64-support-for-mysql.patch index fb6215c..f23b884 100644 --- a/add-loongarch64-support-for-mysql.patch +++ b/add-loongarch64-support-for-mysql.patch @@ -5,7 +5,7 @@ Subject: [PATCH] add loongarch64 support for mysql --- boost/boost_1_77_0/boost/predef/other/endian.h | 1 + - .../icu/icu-release-69-1/source/i18n/double-conversion-utils.h | 3 ++- + .../icu/icu-release-73-1/source/i18n/double-conversion-utils.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/boost/boost_1_77_0/boost/predef/other/endian.h b/boost/boost_1_77_0/boost/predef/other/endian.h @@ -20,13 +20,13 @@ index d8ec63ff..255a2587 100644 defined(__e2k__) # undef BOOST_ENDIAN_LITTLE_BYTE # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE -diff --git a/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h b/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h +diff --git a/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h b/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h index c9374636..44e55d58 100644 ---- a/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h -+++ b/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h -@@ -128,7 +128,8 @@ int main(int argc, char** argv) { +--- a/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h ++++ b/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h +@@ -160,7 +160,8 @@ int main(int argc, char** argv) { defined(__riscv) || defined(__e2k__) || \ - defined(__or1k__) || defined(__arc__) || \ + defined(__or1k__) || defined(__arc__) || defined(__ARC64__) || \ defined(__microblaze__) || defined(__XTENSA__) || \ - defined(__EMSCRIPTEN__) || defined(__wasm32__) + defined(__EMSCRIPTEN__) || defined(__wasm32__) || \ diff --git a/download b/download index e13a9a9..7cb5494 100644 --- a/download +++ b/download @@ -1 +1 @@ -20ffc71fb8acd705cdc4a8ae4cdedf23 mysql-boost-8.0.33.tar.gz +e0cb61cbf6e1144c452368c4535ae931 mysql-boost-8.0.37.tar.gz diff --git a/mysql-mtr.patch b/mysql-mtr.patch index 6f193b9..2b47b20 100644 --- a/mysql-mtr.patch +++ b/mysql-mtr.patch @@ -80,9 +80,11 @@ I'm not sure whether the output is synchronous, but even if it wasn'tit still lo ---- mysql-8.0.24/mysql-test/mysql-test-run.pl 2021-05-10 04:29:44.391897891 +0200 -+++ mysql-8.0.24/mysql-test/mysql-test-run.pl_patched 2021-05-10 04:38:51.031702753 +0200 -@@ -3374,17 +3374,6 @@ sub setup_vardir() { +diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl +index 26e6c92c..9d85c6d6 100755 +--- a/mysql-test/mysql-test-run.pl ++++ b/mysql-test/mysql-test-run.pl +@@ -3551,17 +3551,6 @@ sub setup_vardir() { mkpath("$opt_vardir/tmp"); mkpath($opt_tmpdir) if ($opt_tmpdir ne "$opt_vardir/tmp"); @@ -99,4 +101,4 @@ I'm not sure whether the output is synchronous, but even if it wasn'tit still lo - # Copy all files from std_data into var/std_data # and make them world readable - copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022"); + copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022") diff --git a/mysql.spec b/mysql.spec index 0a47e0a..1df8411 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,4 +1,4 @@ -%define anolis_release 3 +%define anolis_release 1 # Name of the package without any prefixes %global pkg_name %{name} %global pkgnamepatch mysql @@ -14,7 +14,7 @@ # The last version on which the full testsuite has been run # In case of further rebuilds of that version, don't require full testsuite to be run # run only "main" suite -%global last_tested_version 8.0.33 +%global last_tested_version 8.0.37 # Set to 1 to force run the testsuite even if it was already tested in current version %global force_run_testsuite 0 # Aditional SELinux rules @@ -75,7 +75,7 @@ %global sameevr %{?epoch:%{epoch}:}%{version}-%{release} Name: mysql -Version: 8.0.33 +Version: 8.0.37 Release: %{anolis_release}%{?dist} Summary: MySQL client programs and shared libraries URL: http://www.mysql.com @@ -84,7 +84,7 @@ URL: http://www.mysql.com # not only GPL code. See README.mysql-license License: GPLv2 with exceptions and LGPLv2 and BSD -Source0: https://downloads.mysql.com/archives/get/p/23/file/%{name}-boost-%{version}.tar.gz +Source0: https://dev.mysql.com/get/Downloads/MySQL-8.0/%{name}-boost-%{version}.tar.gz Source2: mysql_config_multilib.sh Source3: my.cnf.in Source6: README.mysql-docs @@ -931,6 +931,9 @@ fi %endif %changelog +* Wed May 15 2024 mgb01105731 - 8.0.37-1 +- update to 8.0.37 + * Fri Jan 12 2024 Wenlong Zhang - 8.0.33-3 - mysql 8.0.33 binary crashes on startup on loongarch64 diff --git a/revert-be8348a7.patch b/revert-be8348a7.patch index b394e3a..4c0554c 100644 --- a/revert-be8348a7.patch +++ b/revert-be8348a7.patch @@ -1,76 +1,37 @@ -From 0f8503643565e78b13c3d61a6839c149bccab9c6 Mon Sep 17 00:00:00 2001 -From: Wenlong Zhang -Date: Fri, 12 Jan 2024 14:56:17 +0800 -Subject: [PATCH] revert be8348a7 -This patch reverts the following commit: - -From be8348a7c3e8510b998a063065b626a459631b32 Mon Sep 17 00:00:00 2001 -From: Slawomir Maludzinski -Date: Mon, 12 Dec 2022 15:37:29 +0100 -Subject: [PATCH] BUG#34849343 Aligned_atomic not working as intended - - aligned_alloc - -Problem -------- -The Aligned_atomic class in sql/memory/aligned_atomic.h was created with the -intention to align and pad a std::atomic object so that it starts at the -beginning of a cache line and is padded so that it fills the entire cache -line. The intended use case was to ensure that an array of Aligned_atomic -objects keeps the elements in contiguous memory but different cache lines, -eliminating false sharing. - -Aligned_atomic is implemented by constructing a new char* buffer the size of -a cache line, and then in-place-construct a std::atomic at the beginning -of the buffer. It keeps a std::atomic* as a member; this member is aligned -to the cache line size. - -This only has performance impact, no functional defect. - -Analysis / Root-cause analysis ------------------------------- -This implementation does not seem meet the intentions, AFAIU: -- There is a call to `new` for each Aligned_atomic object. So the elements -are not contiguous. -- The pointer to the buffer is aligned, but not the buffer itself. So it is -possible that the buffer begins in the middle of a cache line and extends -into the next cache line. In fact, if the alignment is smaller than the size -of the atomic type, an std::atomic may intersect with two cache lines, and if -two such objects end up adjacent to each other, there can be false sharing. -More likely, there can be false sharing between the Aligned_atomic and some -object of another type. - -The major drawback is probably that the construction of an array of -Aligned_atomic will allocate many small objects instead of one big, which -uses more memory and CPU than necessary. +From 1f0f4253818b349bdc0f79d1b3bda0e747008ed2 Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Wed, 12 Jun 2024 11:14:45 +0800 +Subject: [PATCH 1/1] revert-be8348a7 --- - include/my_aligned_malloc.h | 55 ---------------- + include/my_aligned_malloc.h | 56 ---------------- mysys/CMakeLists.txt | 1 - - mysys/my_aligned_malloc.cc | 79 ----------------------- - sql/memory/aligned_atomic.h | 71 ++++++-------------- + mysys/my_aligned_malloc.cc | 80 ----------------------- + sql/memory/aligned_atomic.h | 70 +++++--------------- unittest/gunit/memory/aligned_atomic-t.cc | 34 ---------- - 5 files changed, 18 insertions(+), 222 deletions(-) + 5 files changed, 17 insertions(+), 224 deletions(-) delete mode 100644 include/my_aligned_malloc.h delete mode 100644 mysys/my_aligned_malloc.cc diff --git a/include/my_aligned_malloc.h b/include/my_aligned_malloc.h deleted file mode 100644 -index 1673b744..00000000 +index 5ede856f..00000000 --- a/include/my_aligned_malloc.h +++ /dev/null -@@ -1,55 +0,0 @@ --/* Copyright (c) 2022, 2023, Oracle and/or its affiliates. +@@ -1,56 +0,0 @@ +-/* Copyright (c) 2022, 2024, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - -- This program is also distributed with certain software (including +- This program is designed to work with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the -- separately licensed software that they have included with MySQL. +- separately licensed software that they have either included with +- the program or referenced in the documentation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -115,10 +76,10 @@ index 1673b744..00000000 - -#endif /* __MY_ALIGNED_MALLOC_H__ */ diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt -index 7b2f108c..e83d1642 100644 +index bd8fc3a6..55ad8adb 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt -@@ -55,7 +55,6 @@ SET(MYSYS_SOURCES +@@ -56,7 +56,6 @@ SET(MYSYS_SOURCES mf_wcomp.cc mulalloc.cc my_access.cc @@ -128,22 +89,23 @@ index 7b2f108c..e83d1642 100644 my_bitmap.cc diff --git a/mysys/my_aligned_malloc.cc b/mysys/my_aligned_malloc.cc deleted file mode 100644 -index 8de56246..00000000 +index c0799fe5..00000000 --- a/mysys/my_aligned_malloc.cc +++ /dev/null -@@ -1,79 +0,0 @@ --/* Copyright (c) 2022, 2023, Oracle and/or its affiliates. +@@ -1,80 +0,0 @@ +-/* Copyright (c) 2022, 2024, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - -- This program is also distributed with certain software (including +- This program is designed to work with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the -- separately licensed software that they have included with MySQL. +- separately licensed software that they have either included with +- the program or referenced in the documentation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -212,21 +174,19 @@ index 8de56246..00000000 -#endif -} diff --git a/sql/memory/aligned_atomic.h b/sql/memory/aligned_atomic.h -index 423366da..985efb75 100644 +index 3eaa398b..95f664e1 100644 --- a/sql/memory/aligned_atomic.h +++ b/sql/memory/aligned_atomic.h -@@ -38,9 +38,8 @@ +@@ -39,8 +39,6 @@ #include #endif -#include "my_aligned_malloc.h" - namespace memory { -+ /** Calculates and returns the size of the CPU cache line. - -@@ -259,28 +258,14 @@ class Aligned_atomic { +@@ -261,28 +259,14 @@ class Aligned_atomic { @return The pointer to the underlying `std::atomic` object. */ @@ -257,7 +217,7 @@ index 423366da..985efb75 100644 /* The size of `std::atomic`, as returned by `sizeof std::atomic`. -@@ -298,7 +283,7 @@ class Aligned_atomic { +@@ -300,7 +284,7 @@ class Aligned_atomic { /** The size of the byte buffer. */ size_t m_storage_size{0}; /** The byte buffer to use as underlying storage. */ @@ -266,7 +226,7 @@ index 423366da..985efb75 100644 /** The pointer to the underlying `std::atomic` object. */ std::atomic *m_underlying{nullptr}; }; -@@ -306,10 +291,9 @@ class Aligned_atomic { +@@ -308,10 +292,9 @@ class Aligned_atomic { template memory::Aligned_atomic::Aligned_atomic() @@ -280,7 +240,7 @@ index 423366da..985efb75 100644 template memory::Aligned_atomic::Aligned_atomic(T value) -@@ -318,16 +302,12 @@ memory::Aligned_atomic::Aligned_atomic(T value) +@@ -320,16 +303,12 @@ memory::Aligned_atomic::Aligned_atomic(T value) } template @@ -301,7 +261,7 @@ index 423366da..985efb75 100644 rhs.m_underlying = nullptr; } -@@ -335,25 +315,22 @@ template +@@ -337,25 +316,22 @@ template memory::Aligned_atomic::~Aligned_atomic() { if (this->m_underlying != nullptr) { this->m_underlying->~atomic(); @@ -332,7 +292,7 @@ index 423366da..985efb75 100644 rhs.m_underlying = nullptr; return (*this); } -@@ -393,25 +370,13 @@ bool memory::Aligned_atomic::operator!=(T rhs) const { +@@ -395,25 +371,13 @@ bool memory::Aligned_atomic::operator!=(T rhs) const { } template @@ -361,10 +321,10 @@ index 423366da..985efb75 100644 return *this->m_underlying; } diff --git a/unittest/gunit/memory/aligned_atomic-t.cc b/unittest/gunit/memory/aligned_atomic-t.cc -index 39ac0724..63fdc3aa 100644 +index 71a67498..7f6c710c 100644 --- a/unittest/gunit/memory/aligned_atomic-t.cc +++ b/unittest/gunit/memory/aligned_atomic-t.cc -@@ -25,9 +25,7 @@ +@@ -26,9 +26,7 @@ #include #include @@ -374,7 +334,7 @@ index 39ac0724..63fdc3aa 100644 #include #include -@@ -59,37 +57,5 @@ TEST_F(Aligned_atomic_test, Class_template_test) { +@@ -60,37 +58,5 @@ TEST_F(Aligned_atomic_test, Class_template_test) { EXPECT_EQ(atm3->load(), 2); } -- Gitee