git: da87c36f4e19 - main - databases/xtrabackup: update to 2.4.28

From: Oleksii Samorukov <samm_at_FreeBSD.org>
Date: Mon, 05 Jun 2023 21:07:21 UTC
The branch main has been updated by samm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=da87c36f4e198043d4fc8ea8fc19f1ae73fc1661

commit da87c36f4e198043d4fc8ea8fc19f1ae73fc1661
Author:     Oleksii Samorukov <samm@FreeBSD.org>
AuthorDate: 2023-06-05 21:03:17 +0000
Commit:     Oleksii Samorukov <samm@FreeBSD.org>
CommitDate: 2023-06-05 21:05:59 +0000

    databases/xtrabackup: update to 2.4.28
    
    - Remove outdated patches and sync some patches from databases/mysql
    - Update version
    
    ChangeLog: https://docs.percona.com/percona-xtrabackup/2.4/release-notes.html
---
 databases/xtrabackup/Makefile                      |  2 +-
 databases/xtrabackup/distinfo                      |  6 ++--
 .../files/patch-cmake-install_layout.cmake         |  4 +--
 .../xtrabackup/files/patch-cmake_os_FreeBSD.cmake  | 10 +++---
 .../xtrabackup/files/patch-include_my__compare.h   | 11 +++++++
 databases/xtrabackup/files/patch-include_myisam.h  | 11 +++++++
 .../patch-sql_conn__handler_socket__connection.cc  | 32 ++++++++++++++++++
 .../files/patch-sql_locks_shared__spin__lock.cc    | 11 +++++++
 databases/xtrabackup/files/patch-sql_sys__vars.cc  | 38 ++++++++++++++++++++++
 .../files/patch-storage-myisam-mi_dynrec.c         |  4 +--
 .../files/patch-storage_innobase_fsp_fsp0fsp.cc    |  4 +--
 ...h-storage_innobase_xtrabackup_src_ds__tmpfile.c | 11 -------
 ...atch-storage_innobase_xtrabackup_src_xbstream.c | 10 ------
 13 files changed, 118 insertions(+), 36 deletions(-)

diff --git a/databases/xtrabackup/Makefile b/databases/xtrabackup/Makefile
index b984c86c2282..c759124e9a52 100644
--- a/databases/xtrabackup/Makefile
+++ b/databases/xtrabackup/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	xtrabackup
-DISTVERSION=	2.4.21
+DISTVERSION=	2.4.28
 CATEGORIES=	databases
 MASTER_SITES=	https://www.percona.com/downloads/Percona-XtraBackup-${PORTVERSION:R}/Percona-XtraBackup-${PORTVERSION}/source/tarball/:xtrabackup \
 		https://ftp.osuosl.org/pub/blfs/conglomeration/boost/:boost SF/boost/boost/1.59.0/:boost
diff --git a/databases/xtrabackup/distinfo b/databases/xtrabackup/distinfo
index 2a26d91ed656..ed854fdc0fa2 100644
--- a/databases/xtrabackup/distinfo
+++ b/databases/xtrabackup/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1610454639
-SHA256 (percona-xtrabackup-2.4.21.tar.gz) = 6427b16348c181df8b570bc9e7c16374fef81277dd8677628ae3b9fb608548cc
-SIZE (percona-xtrabackup-2.4.21.tar.gz) = 61901220
+TIMESTAMP = 1685991049
+SHA256 (percona-xtrabackup-2.4.28.tar.gz) = 1d77f920a0cf536e12ddcd3a154583b1b52cd3db35bd2d06db629cc255367cea
+SIZE (percona-xtrabackup-2.4.28.tar.gz) = 62525343
 SHA256 (boost_1_59_0.tar.bz2) = 727a932322d94287b62abb1bd2d41723eec4356a7728909e38adb65ca25241ca
 SIZE (boost_1_59_0.tar.bz2) = 70389425
diff --git a/databases/xtrabackup/files/patch-cmake-install_layout.cmake b/databases/xtrabackup/files/patch-cmake-install_layout.cmake
index e823abeffe31..48409561fcf5 100644
--- a/databases/xtrabackup/files/patch-cmake-install_layout.cmake
+++ b/databases/xtrabackup/files/patch-cmake-install_layout.cmake
@@ -1,6 +1,6 @@
---- cmake/install_layout.cmake.orig	2020-04-10 19:45:19 UTC
+--- cmake/install_layout.cmake.orig	2023-03-14 11:58:56 UTC
 +++ cmake/install_layout.cmake
-@@ -160,7 +160,7 @@ SET(INSTALL_INFODIR_STANDALONE          "docs")
+@@ -167,7 +167,7 @@ SET(INSTALL_INFODIR_STANDALONE          "docs")
  #
  SET(INSTALL_SHAREDIR_STANDALONE         "share")
  SET(INSTALL_MYSQLSHAREDIR_STANDALONE    "share")
diff --git a/databases/xtrabackup/files/patch-cmake_os_FreeBSD.cmake b/databases/xtrabackup/files/patch-cmake_os_FreeBSD.cmake
index 2b65a3faef22..3610fac4b5d2 100644
--- a/databases/xtrabackup/files/patch-cmake_os_FreeBSD.cmake
+++ b/databases/xtrabackup/files/patch-cmake_os_FreeBSD.cmake
@@ -1,8 +1,8 @@
---- cmake/os/FreeBSD.cmake.orig	2020-05-26 05:35:19 UTC
+--- cmake/os/FreeBSD.cmake.orig	2023-03-14 11:58:56 UTC
 +++ cmake/os/FreeBSD.cmake
-@@ -36,6 +36,20 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER)
-     IF(GCC_VERSION VERSION_LESS 4.4)
-       MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!")
+@@ -45,6 +45,20 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER)
+     IF(NOT HAVE_SUPPORTED_CLANG_VERSION)
+       MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!")
      ENDIF()
 +    CHECK_C_SOURCE_RUNS("
 +      int main()
@@ -21,7 +21,7 @@
    ELSE()
      MESSAGE(FATAL_ERROR "Unsupported compiler!")
    ENDIF()
-@@ -44,4 +58,6 @@ ENDIF()
+@@ -53,4 +67,6 @@ ENDIF()
  # Should not be needed any more, but kept for easy resurrection if needed
  #   #Legacy option, maybe not needed anymore , taken as is from autotools build
  #   ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000)
diff --git a/databases/xtrabackup/files/patch-include_my__compare.h b/databases/xtrabackup/files/patch-include_my__compare.h
new file mode 100644
index 000000000000..24205abdee3e
--- /dev/null
+++ b/databases/xtrabackup/files/patch-include_my__compare.h
@@ -0,0 +1,11 @@
+--- include/my_compare.h.orig	2019-10-21 05:21:41 UTC
++++ include/my_compare.h
+@@ -47,7 +47,7 @@ extern "C" {
+   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
+ */
+ 
+-#define HA_MAX_KEY_LENGTH           1000        /* Max length in bytes */
++#define HA_MAX_KEY_LENGTH           4000        /* Max length in bytes */
+ #define HA_MAX_KEY_SEG              16          /* Max segments for key */
+ 
+ #define HA_MAX_POSSIBLE_KEY_BUFF    (HA_MAX_KEY_LENGTH + 24+ 6+6)
diff --git a/databases/xtrabackup/files/patch-include_myisam.h b/databases/xtrabackup/files/patch-include_myisam.h
new file mode 100644
index 000000000000..228303eaf909
--- /dev/null
+++ b/databases/xtrabackup/files/patch-include_myisam.h
@@ -0,0 +1,11 @@
+--- include/myisam.h.orig	2019-10-21 05:21:41 UTC
++++ include/myisam.h
+@@ -52,7 +52,7 @@ extern "C" {
+   The following defines can be increased if necessary.
+   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
+ */
+-#define MI_MAX_KEY_LENGTH           1000            /* Max length in bytes */
++#define MI_MAX_KEY_LENGTH           4000            /* Max length in bytes */
+ #define MI_MAX_KEY_SEG              16              /* Max segments for key */
+ 
+ #define MI_MAX_KEY_BUFF  (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
diff --git a/databases/xtrabackup/files/patch-sql_conn__handler_socket__connection.cc b/databases/xtrabackup/files/patch-sql_conn__handler_socket__connection.cc
new file mode 100644
index 000000000000..5afdb1cfd53e
--- /dev/null
+++ b/databases/xtrabackup/files/patch-sql_conn__handler_socket__connection.cc
@@ -0,0 +1,32 @@
+--- sql/conn_handler/socket_connection.cc.orig	2019-10-21 05:21:41 UTC
++++ sql/conn_handler/socket_connection.cc
+@@ -953,22 +953,25 @@ Channel_info* Mysqld_socket_listener::listen_for_conne
+     signal(SIGCHLD, SIG_DFL);
+     request_init(&req, RQ_DAEMON, m_libwrap_name, RQ_FILE,
+                  mysql_socket_getfd(connect_sock), NULL);
+-    fromhost(&req);
++    void (*my_fromhost) (void *) = (void (*)(void *)) fromhost;
++    my_fromhost(&req);
+ 
+-    if (!hosts_access(&req))
++    int (*my_hosts_access) (void *) = (int (*) (void *)) hosts_access;
++    if (!my_hosts_access(&req))
+     {
+       /*
+         This may be stupid but refuse() includes an exit(0)
+         which we surely don't want...
+         clean_exit() - same stupid thing ...
+       */
++      char *(*my_eval_client) (void *) = (char *(*) (void *)) eval_client;
+       syslog(LOG_AUTH | m_deny_severity,
+-             "refused connect from %s", eval_client(&req));
++             "refused connect from %s", my_eval_client(&req));
+ 
+ #ifdef HAVE_LIBWRAP_PROTOTYPES
+       // Some distros have patched tcpd.h to have proper prototypes
+       if (req.sink)
+-        (req.sink)(req.fd);
++        ((void (*)(int)) (req.sink))(req.fd);
+ #else
+       // Some distros have not patched tcpd.h
+       if (req.sink)
diff --git a/databases/xtrabackup/files/patch-sql_locks_shared__spin__lock.cc b/databases/xtrabackup/files/patch-sql_locks_shared__spin__lock.cc
new file mode 100644
index 000000000000..b581258780b9
--- /dev/null
+++ b/databases/xtrabackup/files/patch-sql_locks_shared__spin__lock.cc
@@ -0,0 +1,11 @@
+--- sql/locks/shared_spin_lock.cc.orig	2023-06-05 20:41:14 UTC
++++ sql/locks/shared_spin_lock.cc
+@@ -239,7 +239,7 @@ lock::Shared_spin_lock &lock::Shared_spin_lock::try_or
+   {
+     this->spin_exclusive_lock();
+   }
+-#if defined(__APPLE__)
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   my_atomic_store64(&this->m_exclusive_owner, reinterpret_cast<int64>(self));
+ #else
+   my_atomic_store64(&this->m_exclusive_owner, self);
diff --git a/databases/xtrabackup/files/patch-sql_sys__vars.cc b/databases/xtrabackup/files/patch-sql_sys__vars.cc
new file mode 100644
index 000000000000..52c636089b2d
--- /dev/null
+++ b/databases/xtrabackup/files/patch-sql_sys__vars.cc
@@ -0,0 +1,38 @@
+--- sql/sys_vars.cc.orig	2021-06-16 10:56:53 UTC
++++ sql/sys_vars.cc
+@@ -1749,7 +1749,7 @@ static Sys_var_ulong Sys_interactive_timeout(
+        "connection before closing it",
+        SESSION_VAR(net_interactive_timeout),
+        CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+ 
+ static Sys_var_ulong Sys_join_buffer_size(
+        "join_buffer_size",
+@@ -2629,7 +2629,7 @@ static Sys_var_ulong Sys_net_read_timeout(
+        "Number of seconds to wait for more data from a connection before "
+        "aborting the read",
+        SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
+        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+        ON_UPDATE(fix_net_read_timeout));
+ 
+@@ -2653,7 +2653,7 @@ static Sys_var_ulong Sys_net_write_timeout(
+        "Number of seconds to wait for a block to be written to a connection "
+        "before aborting the write",
+        SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
++       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
+        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+        ON_UPDATE(fix_net_write_timeout));
+ 
+@@ -4389,7 +4389,7 @@ static Sys_var_ulong Sys_net_wait_timeout(
+        "The number of seconds the server waits for activity on a "
+        "connection before closing it",
+        SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
+-       VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)),
++       VALID_RANGE(1, INT_MAX32/1000),
+        DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+ 
+ static Sys_var_plugin Sys_default_storage_engine(
diff --git a/databases/xtrabackup/files/patch-storage-myisam-mi_dynrec.c b/databases/xtrabackup/files/patch-storage-myisam-mi_dynrec.c
index 4436e2e4b195..def5cf714845 100644
--- a/databases/xtrabackup/files/patch-storage-myisam-mi_dynrec.c
+++ b/databases/xtrabackup/files/patch-storage-myisam-mi_dynrec.c
@@ -1,6 +1,6 @@
---- storage/myisam/mi_dynrec.c.orig	2020-04-10 19:45:19 UTC
+--- storage/myisam/mi_dynrec.c.orig	2023-03-14 11:58:56 UTC
 +++ storage/myisam/mi_dynrec.c
-@@ -65,18 +65,13 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
+@@ -72,18 +72,13 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
      DBUG_RETURN(1);
    }
    /*
diff --git a/databases/xtrabackup/files/patch-storage_innobase_fsp_fsp0fsp.cc b/databases/xtrabackup/files/patch-storage_innobase_fsp_fsp0fsp.cc
index 86d7e46582fb..8207474b1ced 100644
--- a/databases/xtrabackup/files/patch-storage_innobase_fsp_fsp0fsp.cc
+++ b/databases/xtrabackup/files/patch-storage_innobase_fsp_fsp0fsp.cc
@@ -1,6 +1,6 @@
---- storage/innobase/fsp/fsp0fsp.cc.orig	2020-04-10 19:45:19 UTC
+--- storage/innobase/fsp/fsp0fsp.cc.orig	2023-03-14 11:58:56 UTC
 +++ storage/innobase/fsp/fsp0fsp.cc
-@@ -1289,7 +1289,7 @@ fsp_header_decode_encryption_info(
+@@ -1293,7 +1293,7 @@ fsp_header_decode_encryption_info(
  
  	if (elen == MY_AES_BAD_DATA) {
  		my_free(master_key);
diff --git a/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_ds__tmpfile.c b/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_ds__tmpfile.c
deleted file mode 100644
index 1354c60ff98c..000000000000
--- a/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_ds__tmpfile.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- storage/innobase/xtrabackup/src/ds_tmpfile.c.orig	2020-04-10 19:45:19 UTC
-+++ storage/innobase/xtrabackup/src/ds_tmpfile.c
-@@ -55,7 +55,7 @@ datasink_t datasink_tmpfile = {
- 	&tmpfile_deinit
- };
- 
--MY_TMPDIR mysql_tmpdir_list;
-+extern MY_TMPDIR mysql_tmpdir_list;
- 
- static ds_ctxt_t *
- tmpfile_init(const char *root)
diff --git a/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_xbstream.c b/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_xbstream.c
deleted file mode 100644
index 2542052b2790..000000000000
--- a/databases/xtrabackup/files/patch-storage_innobase_xtrabackup_src_xbstream.c
+++ /dev/null
@@ -1,10 +0,0 @@
---- storage/innobase/xtrabackup/src/xbstream.c.orig	2020-04-10 19:45:19 UTC
-+++ storage/innobase/xtrabackup/src/xbstream.c
-@@ -55,7 +55,6 @@ datasink_t datasink_xbstream;
- datasink_t datasink_compress;
- datasink_t datasink_tmpfile;
- datasink_t datasink_encrypt;
--datasink_t datasink_buffer;
- 
- static run_mode_t	opt_mode;
- static char *		opt_directory = NULL;