diff --git a/build-ps/percona-server-8.0_builder.sh b/build-ps/percona-server-8.0_builder.sh index 6c5c5d948ead..d7551ac8e64c 100644 --- a/build-ps/percona-server-8.0_builder.sh +++ b/build-ps/percona-server-8.0_builder.sh @@ -435,6 +435,11 @@ install_deps() { if [ "x${RHEL}" = "x8" -o "x${RHEL}" = "x7" ]; then switch_to_vault_repo fi + if [ "x${RHEL}" = "x7" ]; then + sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-Base.repo + sed -i 's|^#baseurl=|baseurl=|g' /etc/yum.repos.d/CentOS-Base.repo + sed -i 's|mirror.centos.org|vault.centos.org|g' /etc/yum.repos.d/CentOS-Base.repo + fi if [ x"$ARCH" = "xx86_64" ]; then if [ "${RHEL}" -lt 8 ]; then # add_percona_yum_repo @@ -1120,25 +1125,25 @@ OS= TOKUBACKUP_REPO= PERCONAFT_REPO= INSTALL=0 -RPM_RELEASE=1 -DEB_RELEASE=1 +RPM_RELEASE=2 +DEB_RELEASE=2 DEBUG=0 REVISION=0 -BRANCH="release-8.0.30-22" -RPM_RELEASE=1 -DEB_RELEASE=1 +BRANCH="CUSTOM-220" +RPM_RELEASE=2 +DEB_RELEASE=2 MECAB_INSTALL_DIR="${WORKDIR}/mecab-install" REPO="https://github.com/percona/percona-server.git" PRODUCT=Percona-Server-8.0 MYSQL_VERSION_MAJOR=8 MYSQL_VERSION_MINOR=0 -MYSQL_VERSION_PATCH=30 -MYSQL_VERSION_EXTRA=-22 -PRODUCT_FULL=Percona-Server-8.0.30 +MYSQL_VERSION_PATCH=42 +MYSQL_VERSION_EXTRA=-33 +PRODUCT_FULL=Percona-Server-8.0.42 BOOST_PACKAGE_NAME=boost_1_77_0 BUILD_TOKUDB_TOKUBACKUP=0 -PERCONAFT_BRANCH=Percona-Server-8.0.30-22 -TOKUBACKUP_BRANCH=Percona-Server-8.0.30-22 +PERCONAFT_BRANCH=Percona-Server-8.0.42-33 +TOKUBACKUP_BRANCH=Percona-Server-8.0.42-33 parse_arguments PICK-ARGS-FROM-ARGV "$@" check_workdir diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index 36bc1ebbe069..60a61264bb32 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -106,7 +106,7 @@ %global compatver 5.6.51 %global percona_compatver 91.0 %global compatlib 18 -%global compatsrc https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-%{compatver}-%{percona_compatver}/binary/redhat/7/x86_64/Percona-Server-shared-56-%{compatver}-rel%{percona_compatver}.1.el7.x86_64.rpm +%global compatsrc https://repo.percona.com/yum/release/7/RPMS/x86_64/Percona-Server-shared-56-5.6.51-rel91.0.1.el7.x86_64.rpm %endif %if 0%{?rhel} == 6 diff --git a/extra/opensslpp/src/opensslpp/evp_pkey.cpp b/extra/opensslpp/src/opensslpp/evp_pkey.cpp index 5f1d60ab559c..29a8f01812f5 100644 --- a/extra/opensslpp/src/opensslpp/evp_pkey.cpp +++ b/extra/opensslpp/src/opensslpp/evp_pkey.cpp @@ -20,6 +20,18 @@ #include #include +#include // Needed for EVP_PKEY_get0_RSA + +#ifndef EVP_PKEY_get0_RSA +extern "C" { +static inline const RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey) { + if (!pkey || EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA) + return nullptr; + return pkey->pkey.rsa; +} +} +#endif + #include @@ -81,16 +93,12 @@ void evp_pkey::evp_pkey_deleter::operator()(void *evp_pkey) const noexcept { evp_pkey::evp_pkey(const evp_pkey &obj) : impl_{} { if (!obj.is_empty()) { #if OPENSSL_VERSION_NUMBER >= 0x30000000L - // due to a bug in openssl interface, EVP_PKEY_dup() expects - // non-const parameter while it does not do any modifications with the - // object - it just performs duplication via ASN1_item_i2d/ASN1_item_d2i - // conversions - impl_.reset(EVP_PKEY_dup(evp_pkey_accessor::get_impl_const_casted(obj))); - if (!impl_) { - throw core_error{"cannot duplicate EVP_PKEY key"}; - } + impl_.reset(EVP_PKEY_dup(evp_pkey_accessor::get_impl_const_casted(obj))); + if (!impl_) { + throw core_error{"cannot duplicate EVP_PKEY key"}; + } #else - duplicate_evp_pkey(*this, obj, !obj.is_private()); + duplicate_evp_pkey(*this, obj, !obj.is_private()); #endif } } @@ -105,14 +113,14 @@ void evp_pkey::swap(evp_pkey &obj) noexcept { impl_.swap(obj.impl_); } evp_pkey_algorithm evp_pkey::get_algorithm() const noexcept { assert(!is_empty()); - auto native_algorithm{EVP_PKEY_base_id(evp_pkey_accessor::get_impl(*this))}; + auto native_algorithm{EVP_PKEY_base_id( + const_cast(evp_pkey_accessor::get_impl(*this)))}; return native_algorithm_to_evp_pkey_algorithm(native_algorithm); } bool evp_pkey::is_private() const noexcept { assert(!is_empty()); - // TODO: implement checks for other algorithms const auto *native_rsa{ EVP_PKEY_get0_RSA(evp_pkey_accessor::get_impl_const_casted(*this))}; assert(native_rsa != nullptr); @@ -125,12 +133,12 @@ bool evp_pkey::is_private() const noexcept { std::size_t evp_pkey::get_size_in_bits() const noexcept { assert(!is_empty()); - return EVP_PKEY_bits(evp_pkey_accessor::get_impl(*this)); + return EVP_PKEY_bits(const_cast(evp_pkey_accessor::get_impl(*this))); } std::size_t evp_pkey::get_size_in_bytes() const noexcept { assert(!is_empty()); - return EVP_PKEY_size(evp_pkey_accessor::get_impl(*this)); + return EVP_PKEY_size(const_cast(evp_pkey_accessor::get_impl(*this))); } evp_pkey evp_pkey::derive_public_key() const { @@ -160,7 +168,6 @@ class evp_pkey_keygen_ctx { } evp_pkey generate(std::size_t bits) { - // TODO: implement setting bit length for other algorithms if (EVP_PKEY_CTX_set_rsa_keygen_bits(impl_.get(), bits) <= 0) { throw core_error{"cannot set EVP_PKEY context key generation parameters"}; } diff --git a/include/my_checksum.h b/include/my_checksum.h index 64de63e2698e..d4adf9075274 100644 --- a/include/my_checksum.h +++ b/include/my_checksum.h @@ -34,10 +34,17 @@ #include // std::uint32_t #include // std::numeric_limits #include // std::is_convertible +#include // memcpy -#include // crc32_z +#include // crc32 or crc32_z -#include "my_compiler.h" // My_ATTRIBUTE +#if ZLIB_VERNUM >= 0x1290 + #define MY_CRC32(crc, buf, len) crc32_z(crc, buf, len) +#else + #define MY_CRC32(crc, buf, len) crc32(crc, buf, len) +#endif + +#include "my_compiler.h" // MY_ATTRIBUTE #include "my_config.h" #ifdef HAVE_ARMV8_CRC32_INTRINSIC @@ -77,7 +84,7 @@ inline std::uint32_t IntegerCrc32(std::uint32_t crc, I i) { unsigned char buf[sizeof(I)]; memcpy(buf, &i, sizeof(I)); crc = ~crc; - crc = crc32_z(crc, buf, sizeof(I)); + crc = MY_CRC32(crc, buf, sizeof(I)); return ~crc; } @@ -122,7 +129,7 @@ inline ha_checksum my_checksum(ha_checksum crc, const unsigned char *pos, #endif // HAVE_ARMV8_CRC32_INTRINSIC static_assert(std::is_convertible::value, "uLong cannot be converted to ha_checksum"); - assert(crc32_z(crc, pos, length) <= std::numeric_limits::max()); - return crc32_z(crc, pos, length); + assert(MY_CRC32(crc, pos, length) <= std::numeric_limits::max()); + return MY_CRC32(crc, pos, length); } -#endif /* not defined(MY_CEHCKSUM_INCLUDED) */ +#endif /* MY_CHECKSUM_INCLUDED */