From 6328e3e9fe56e3b7e8ac6b8ca1150b7e5e5e50cd Mon Sep 17 00:00:00 2001 From: Michal Hrusecky Date: Sat, 22 Oct 2022 21:34:01 +0200 Subject: [PATCH] mariadb: Update to the latest version 10.9.3 Update to the latest upstream version. For more details, see: https://mariadb.com/kb/en/changes-improvements-in-mariadb-109/ Added new dependency on libfmt. Following two patches dropped as the issues were fixed in upstream. * 130-c11_atomics.patch * 140-mips-connect-unaligned.patch The rest of the patches were refreshed. Don't need to disable cassandra and tokudb anymore as they were dropped from upstream tarball. Signed-off-by: Michal Hrusecky --- utils/mariadb/Makefile | 10 +- utils/mariadb/patches/100-fix_hostname.patch | 2 +- utils/mariadb/patches/130-c11_atomics.patch | 64 ----- .../patches/140-mips-connect-unaligned.patch | 257 ------------------ ...-relax-mysql_install-db-wrt-pam-tool.patch | 6 +- .../190-replace-hostname-in-mysqld_safe.patch | 6 +- utils/mariadb/patches/200-no-selinux.patch | 2 +- utils/mariadb/patches/210-no-altivec.patch | 2 +- 8 files changed, 14 insertions(+), 335 deletions(-) delete mode 100644 utils/mariadb/patches/130-c11_atomics.patch delete mode 100644 utils/mariadb/patches/140-mips-connect-unaligned.patch diff --git a/utils/mariadb/Makefile b/utils/mariadb/Makefile index 31c61a42e5..6bbf2f6570 100644 --- a/utils/mariadb/Makefile +++ b/utils/mariadb/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mariadb -PKG_VERSION:=10.6.4 +PKG_VERSION:=10.9.3 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL := https://archive.mariadb.org/$(PKG_NAME)-$(PKG_VERSION)/source -PKG_HASH:=75bf9b147a95d38160d01a73b098d50a1960563b46d16a235971fff64d99643c +PKG_HASH:=9a1e229972fcccc8270e633f68d3fb824da151dcf4f53da1df8d947aca876bee PKG_MAINTAINER:=Michal Hrusecky PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING THIRDPARTY @@ -35,14 +35,12 @@ SHARE_DIR:=/usr/share/mariadb MARIADB_SOCKET=/var/run/mysql/mysql.sock MARIADB_DISABLE_ENGINES := \ - cassandra \ columnstore \ example \ mroonga \ oqgraph \ rocksdb \ - test_sql_discovery \ - tokudb + test_sql_discovery MARIADB_DISABLE_PLUGINS := \ audit_null \ @@ -171,6 +169,7 @@ include $(INCLUDE_DIR)/cmake.mk MARIADB_COMMON_DEPENDS := \ $(ICONV_DEPENDS) \ +libatomic \ + +libfmt \ +libopenssl \ +libstdcpp \ +zlib @@ -368,6 +367,7 @@ CMAKE_OPTIONS += \ -DWITH_INNODB_SNAPPY=OFF \ -DWITH_JEMALLOC=OFF \ -DWITH_LIBARCHIVE=OFF \ + -DWITH_LIBFMT=system \ -DWITH_LIBWRAP=OFF \ -DWITH_MARIABACKUP=ON \ -DWITH_NUMA=OFF \ diff --git a/utils/mariadb/patches/100-fix_hostname.patch b/utils/mariadb/patches/100-fix_hostname.patch index 1e20f4f928..71bbc5c94c 100644 --- a/utils/mariadb/patches/100-fix_hostname.patch +++ b/utils/mariadb/patches/100-fix_hostname.patch @@ -1,6 +1,6 @@ --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh -@@ -419,7 +419,7 @@ fi +@@ -437,7 +437,7 @@ fi # Try to determine the hostname diff --git a/utils/mariadb/patches/130-c11_atomics.patch b/utils/mariadb/patches/130-c11_atomics.patch deleted file mode 100644 index 80b5a2e77a..0000000000 --- a/utils/mariadb/patches/130-c11_atomics.patch +++ /dev/null @@ -1,64 +0,0 @@ -Author: Vicențiu Ciorbaru -Date: Fri Dec 21 19:14:04 2018 +0200 - - Link with libatomic to enable C11 atomics support - - Some architectures (mips) require libatomic to support proper - atomic operations. Check first if support is available without - linking, otherwise use the library. - ---- a/configure.cmake -+++ b/configure.cmake -@@ -866,7 +866,25 @@ int main() - long long int *ptr= &var; - return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); - }" --HAVE_GCC_C11_ATOMICS) -+HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) -+IF (HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) -+ SET(HAVE_GCC_C11_ATOMICS True) -+ELSE() -+ SET(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) -+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") -+ CHECK_CXX_SOURCE_COMPILES(" -+ int main() -+ { -+ long long int var= 1; -+ long long int *ptr= &var; -+ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); -+ }" -+ HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ SET(HAVE_GCC_C11_ATOMICS True) -+ ENDIF() -+ SET(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES}) -+ENDIF() - - IF(WITH_VALGRIND) - SET(HAVE_valgrind 1) ---- a/mysys/CMakeLists.txt -+++ b/mysys/CMakeLists.txt -@@ -168,6 +168,10 @@ TARGET_LINK_LIBRARIES(mysys dbug strings - ${LIBNSL} ${LIBM} ${LIBRT} ${CMAKE_DL_LIBS} ${LIBSOCKET} ${LIBEXECINFO}) - DTRACE_INSTRUMENT(mysys) - -+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ TARGET_LINK_LIBRARIES(mysys atomic) -+ENDIF() -+ - IF(HAVE_BFD_H) - TARGET_LINK_LIBRARIES(mysys bfd) - ENDIF(HAVE_BFD_H) ---- a/sql/CMakeLists.txt -+++ b/sql/CMakeLists.txt -@@ -324,6 +324,10 @@ IF(WITH_MYSQLD_LDFLAGS) - "${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}") - ENDIF() - -+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ TARGET_LINK_LIBRARIES(sql atomic) -+ENDIF() -+ - - FIND_PACKAGE(BISON 2.0) - diff --git a/utils/mariadb/patches/140-mips-connect-unaligned.patch b/utils/mariadb/patches/140-mips-connect-unaligned.patch deleted file mode 100644 index 7eceffa24c..0000000000 --- a/utils/mariadb/patches/140-mips-connect-unaligned.patch +++ /dev/null @@ -1,257 +0,0 @@ -From: Debian MySQL Maintainers -Date: Thu, 10 Aug 2017 20:40:28 +0200 -Subject: mips-connect-unaligned - ---- - storage/connect/valblk.cpp | 41 ++++++++++++++++++------------------- - storage/connect/valblk.h | 51 +++++++++++++++++++++++++++++----------------- - 2 files changed, 52 insertions(+), 40 deletions(-) - ---- a/storage/connect/valblk.cpp -+++ b/storage/connect/valblk.cpp -@@ -268,14 +268,14 @@ bool TYPBLK::Init(PGLOBAL g, bool - template - char *TYPBLK::GetCharString(char *p, int n) - { -- sprintf(p, Fmt, Typp[n]); -+ sprintf(p, Fmt, UnalignedRead(n)); - return p; - } // end of GetCharString - - template <> - char *TYPBLK::GetCharString(char *p, int n) - { -- sprintf(p, Fmt, Prec, Typp[n]); -+ sprintf(p, Fmt, Prec, UnalignedRead(n)); - return p; - } // end of GetCharString - -@@ -291,7 +291,7 @@ void TYPBLK::SetValue(PVAL valp, i - ChkTyp(valp); - - if (!(b = valp->IsNull())) -- Typp[n] = GetTypedValue(valp); -+ UnalignedWrite(n, GetTypedValue(valp)); - else - Reset(n); - -@@ -353,9 +353,9 @@ void TYPBLK::SetValue(PCSZ p, int - ulonglong val = CharToNumber(p, strlen(p), maxval, Unsigned, &minus); - - if (minus && val < maxval) -- Typp[n] = (TYPE)(-(signed)val); -+ UnalignedWrite(n, (TYPE)(-(signed)val)); - else -- Typp[n] = (TYPE)val; -+ UnalignedWrite(n, (TYPE)val); - - SetNull(n, false); - } // end of SetValue -@@ -398,7 +398,7 @@ void TYPBLK::SetValue(PCSZ p, in - throw Type; - } // endif Check - -- Typp[n] = atof(p); -+ UnalignedWrite(n, atof(p)); - SetNull(n, false); - } // end of SetValue - -@@ -430,7 +430,7 @@ void TYPBLK::SetValue(PVBLK pv, in - ChkTyp(pv); - - if (!(b = pv->IsNull(n2) && Nullable)) -- Typp[n1] = GetTypedValue(pv, n2); -+ UnalignedWrite(n1, GetTypedValue(pv, n2)); - else - Reset(n1); - -@@ -481,10 +481,10 @@ void TYPBLK::SetMin(PVAL valp, int - { - CheckParms(valp, n) - TYPE tval = GetTypedValue(valp); -- TYPE& tmin = Typp[n]; -+ TYPE tmin = UnalignedRead(n); - - if (tval < tmin) -- tmin = tval; -+ UnalignedWrite(n, tval); - - } // end of SetMin - -@@ -496,10 +496,10 @@ void TYPBLK::SetMax(PVAL valp, int - { - CheckParms(valp, n) - TYPE tval = GetTypedValue(valp); -- TYPE& tmin = Typp[n]; -+ TYPE tmin = UnalignedRead(n); - - if (tval > tmin) -- tmin = tval; -+ UnalignedWrite(n, tval); - - } // end of SetMax - -@@ -513,8 +513,7 @@ void TYPBLK::SetValues(PVBLK pv, i - CheckType(pv) - TYPE *lp = ((TYPBLK*)pv)->Typp; - -- for (int i = k; i < n; i++) // TODO -- Typp[i] = lp[i]; -+ memcpy(Typp + k, lp + k, sizeof(TYPE) * n); - - } // end of SetValues - #endif // 0 -@@ -525,7 +524,7 @@ void TYPBLK::SetValues(PVBLK pv, i - template - void TYPBLK::Move(int i, int j) - { -- Typp[j] = Typp[i]; -+ UnalignedWrite(j, UnalignedRead(i)); - MoveNull(i, j); - } // end of Move - -@@ -539,7 +538,7 @@ int TYPBLK::CompVal(PVAL vp, int n - ChkIndx(n); - ChkTyp(vp); - #endif // _DEBUG -- TYPE mlv = Typp[n]; -+ TYPE mlv = UnalignedRead(n); - TYPE vlv = GetTypedValue(vp); - - return (vlv > mlv) ? 1 : (vlv < mlv) ? (-1) : 0; -@@ -551,8 +550,8 @@ int TYPBLK::CompVal(PVAL vp, int n - template - int TYPBLK::CompVal(int i1, int i2) - { -- TYPE lv1 = Typp[i1]; -- TYPE lv2 = Typp[i2]; -+ TYPE lv1 = UnalignedRead(i1); -+ TYPE lv2 = UnalignedRead(i2); - - return (lv1 > lv2) ? 1 : (lv1 < lv2) ? (-1) : 0; - } // end of CompVal -@@ -589,7 +588,7 @@ int TYPBLK::Find(PVAL vp) - TYPE n = GetTypedValue(vp); - - for (i = 0; i < Nval; i++) -- if (n == Typp[i]) -+ if (n == UnalignedRead(i)) - break; - - return (i < Nval) ? i : (-1); -@@ -605,7 +604,7 @@ int TYPBLK::GetMaxLength(void) - int i, n, m; - - for (i = n = 0; i < Nval; i++) { -- m = sprintf(buf, Fmt, Typp[i]); -+ m = sprintf(buf, Fmt, UnalignedRead(i)); - n = MY_MAX(n, m); - } // endfor i - -@@ -1335,7 +1334,7 @@ char *DATBLK::GetCharString(char *p, int - char *vp; - - if (Dvalp) { -- Dvalp->SetValue(Typp[n]); -+ Dvalp->SetValue(UnalignedRead(n)); - vp = Dvalp->GetCharString(p); - } else - vp = TYPBLK::GetCharString(p, n); -@@ -1351,7 +1350,7 @@ void DATBLK::SetValue(PCSZ p, int n) - if (Dvalp) { - // Decode the string according to format - Dvalp->SetValue_psz(p); -- Typp[n] = Dvalp->GetIntValue(); -+ UnalignedWrite(n, Dvalp->GetIntValue()); - } else - TYPBLK::SetValue(p, n); - ---- a/storage/connect/valblk.h -+++ b/storage/connect/valblk.h -@@ -139,6 +139,7 @@ class VALBLK : public BLOCK { - int Prec; // Precision of float values - }; // end of class VALBLK - -+ - /***********************************************************************/ - /* Class TYPBLK: represents a block of typed values. */ - /***********************************************************************/ -@@ -151,40 +152,41 @@ class TYPBLK : public VALBLK { - // Implementation - virtual bool Init(PGLOBAL g, bool check); - virtual int GetVlen(void) {return sizeof(TYPE);} -- virtual char GetTinyValue(int n) {return (char)Typp[n];} -- virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];} -- virtual short GetShortValue(int n) {return (short)Typp[n];} -- virtual ushort GetUShortValue(int n) {return (ushort)Typp[n];} -- virtual int GetIntValue(int n) {return (int)Typp[n];} -- virtual uint GetUIntValue(int n) {return (uint)Typp[n];} -- virtual longlong GetBigintValue(int n) {return (longlong)Typp[n];} -- virtual ulonglong GetUBigintValue(int n) {return (ulonglong)Typp[n];} -- virtual double GetFloatValue(int n) {return (double)Typp[n];} -+ -+ virtual char GetTinyValue(int n) {return (char)UnalignedRead(n);} -+ virtual uchar GetUTinyValue(int n) {return (uchar)UnalignedRead(n);} -+ virtual short GetShortValue(int n) {return (short)UnalignedRead(n);} -+ virtual ushort GetUShortValue(int n) {return (ushort)UnalignedRead(n);} -+ virtual int GetIntValue(int n) {return (int)UnalignedRead(n);} -+ virtual uint GetUIntValue(int n) {return (uint)UnalignedRead(n);} -+ virtual longlong GetBigintValue(int n) {return (longlong)UnalignedRead(n);} -+ virtual ulonglong GetUBigintValue(int n) {return (ulonglong)UnalignedRead(n);} -+ virtual double GetFloatValue(int n) {return (double)UnalignedRead(n);} - virtual char *GetCharString(char *p, int n); -- virtual void Reset(int n) {Typp[n] = 0;} -+ virtual void Reset(int n) {UnalignedWrite(n, 0);} - - // Methods - using VALBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); - virtual void SetValue(const char *sp, uint len, int n); - virtual void SetValue(short sval, int n) -- {Typp[n] = (TYPE)sval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(ushort sval, int n) -- {Typp[n] = (TYPE)sval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(int lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(uint lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(longlong lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(ulonglong lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(double fval, int n) -- {Typp[n] = (TYPE)fval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)fval); SetNull(n, false);} - virtual void SetValue(char cval, int n) -- {Typp[n] = (TYPE)cval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(uchar cval, int n) -- {Typp[n] = (TYPE)cval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(PVAL valp, int n); - virtual void SetValue(PVBLK pv, int n1, int n2); - virtual void SetMin(PVAL valp, int n); -@@ -206,6 +208,17 @@ class TYPBLK : public VALBLK { - // Members - TYPE* const &Typp; - const char *Fmt; -+ -+ // Unaligned access -+ TYPE UnalignedRead(int n) const { -+ TYPE result; -+ memcpy(&result, Typp + n, sizeof(TYPE)); -+ return result; -+ } -+ -+ void UnalignedWrite(int n, TYPE value) { -+ memcpy(Typp + n, &value, sizeof(TYPE)); -+ } - }; // end of class TYPBLK - - /***********************************************************************/ diff --git a/utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch b/utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch index 1971c2adcd..b649ce0395 100644 --- a/utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch +++ b/utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch @@ -1,6 +1,6 @@ --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh -@@ -358,6 +358,14 @@ then +@@ -369,6 +369,14 @@ then exit 1 fi plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin` @@ -15,7 +15,7 @@ pamtooldir=$plugindir # relative from where the script was run for a relocatable install elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mariadbd" -@@ -478,7 +486,9 @@ do +@@ -501,7 +509,9 @@ do fi done @@ -26,7 +26,7 @@ then if test -z "$srcdir" -a "$in_rpm" -eq 0 then -@@ -499,6 +509,10 @@ then +@@ -522,6 +532,10 @@ then echo fi fi diff --git a/utils/mariadb/patches/190-replace-hostname-in-mysqld_safe.patch b/utils/mariadb/patches/190-replace-hostname-in-mysqld_safe.patch index 69d09c0177..4cce4d4fac 100644 --- a/utils/mariadb/patches/190-replace-hostname-in-mysqld_safe.patch +++ b/utils/mariadb/patches/190-replace-hostname-in-mysqld_safe.patch @@ -1,6 +1,6 @@ --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh -@@ -246,7 +246,7 @@ wsrep_recover_position() { +@@ -247,7 +247,7 @@ wsrep_recover_position() { return 1 fi @@ -9,7 +9,7 @@ local wr_options="--disable-log-error --pid-file='$wr_pidfile'" -@@ -667,7 +667,7 @@ then +@@ -669,7 +669,7 @@ then * ) err_log="$DATADIR/$err_log" ;; esac else @@ -18,7 +18,7 @@ fi fi -@@ -746,7 +746,7 @@ fi +@@ -755,7 +755,7 @@ fi if test -z "$pid_file" then diff --git a/utils/mariadb/patches/200-no-selinux.patch b/utils/mariadb/patches/200-no-selinux.patch index 1ab55a9cf6..da60406700 100644 --- a/utils/mariadb/patches/200-no-selinux.patch +++ b/utils/mariadb/patches/200-no-selinux.patch @@ -1,6 +1,6 @@ --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt -@@ -61,7 +61,7 @@ IF(UNIX AND NOT WITHOUT_SERVER) +@@ -62,7 +62,7 @@ IF(UNIX AND NOT WITHOUT_SERVER) INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles) INSTALL(DIRECTORY policy DESTINATION ${inst_location} COMPONENT SupportFiles) FIND_PROGRAM(CHECKMODULE checkmodule) diff --git a/utils/mariadb/patches/210-no-altivec.patch b/utils/mariadb/patches/210-no-altivec.patch index 5c922df9b4..7f4d8d475f 100644 --- a/utils/mariadb/patches/210-no-altivec.patch +++ b/utils/mariadb/patches/210-no-altivec.patch @@ -18,4 +18,4 @@ -# error "my_checksum() is defined in mysys/crc32/crc32_ppc64.c" #endif extern "C" - unsigned int my_checksum(unsigned int crc, const void *data, size_t len) + uint32 my_checksum(uint32 crc, const void *data, size_t len) -- 2.30.2