From 6d4f90321faeda56bdcd443d4f9054776bd9cfcf Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sat, 16 Dec 2023 18:00:28 +0100 Subject: [PATCH] - MySQL 8.2 from PLD --- build.patch | 42 -- drop-sysctl_h.patch | 184 ------- mysql-5.7-sphinx.patch | 357 ++++---------- mysql-chain-certs.patch | 12 - mysql-clusters.conf | 2 +- mysql-cmake.patch | 34 +- mysql-dubious-exports.patch | 55 --- mysql-opt.patch | 92 ++-- mysql-protobuf.patch | 13 - mysql-readline.patch | 33 ++ mysql-sphinx.patch | 15 +- mysql-system-xxhash.patch | 168 +++++++ mysql-versioning.patch | 18 - mysql.init | 184 +++---- mysql.logrotate | 12 +- mysql.spec | 900 +++++++++++++++++------------------ mysqld.conf | 186 +------- mysqldumpslow-clusters.patch | 46 ++ 18 files changed, 972 insertions(+), 1381 deletions(-) delete mode 100644 build.patch delete mode 100644 drop-sysctl_h.patch delete mode 100644 mysql-chain-certs.patch delete mode 100644 mysql-dubious-exports.patch delete mode 100644 mysql-protobuf.patch create mode 100644 mysql-readline.patch create mode 100644 mysql-system-xxhash.patch delete mode 100644 mysql-versioning.patch create mode 100644 mysqldumpslow-clusters.patch diff --git a/build.patch b/build.patch deleted file mode 100644 index cbd9439..0000000 --- a/build.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -urNp -x '*.orig' percona-server-5.7.42-46.org/cmake/maintainer.cmake percona-server-5.7.42-46/cmake/maintainer.cmake ---- percona-server-5.7.42-46.org/cmake/maintainer.cmake 2023-05-29 10:24:29.000000000 +0200 -+++ percona-server-5.7.42-46/cmake/maintainer.cmake 2023-07-18 18:19:10.520022888 +0200 -@@ -45,12 +45,6 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" - STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-unused-parameter -Wno-unused-but-set-variable") - ENDIF() - --# Turn on Werror (warning => error) when using maintainer mode. --IF(MYSQL_MAINTAINER_MODE) -- STRING_APPEND(MY_C_WARNING_FLAGS " -Werror") -- STRING_APPEND(MY_CXX_WARNING_FLAGS " -Werror") --ENDIF() -- - # Set warning flags for GCC/Clang - IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") - STRING_APPEND(CMAKE_C_FLAGS " ${MY_C_WARNING_FLAGS}") -diff -urNp -x '*.orig' percona-server-5.7.42-46.org/storage/rocksdb/CMakeLists.txt percona-server-5.7.42-46/storage/rocksdb/CMakeLists.txt ---- percona-server-5.7.42-46.org/storage/rocksdb/CMakeLists.txt 2023-07-18 18:18:54.474790338 +0200 -+++ percona-server-5.7.42-46/storage/rocksdb/CMakeLists.txt 2023-07-18 18:19:10.520022888 +0200 -@@ -57,7 +57,7 @@ ELSE() - # get a list of rocksdb library source files - # run with env -i to avoid passing variables - EXECUTE_PROCESS( -- COMMAND env -i ${CMAKE_CURRENT_SOURCE_DIR}/get_rocksdb_files.sh -+ COMMAND env -i PATH=$ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/get_rocksdb_files.sh - OUTPUT_VARIABLE SCRIPT_OUTPUT - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) -diff -urNp -x '*.orig' percona-server-5.7.42-46.org/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake percona-server-5.7.42-46/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake ---- percona-server-5.7.42-46.org/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake 2023-05-29 14:06:14.000000000 +0200 -+++ percona-server-5.7.42-46/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake 2023-07-18 18:19:10.520022888 +0200 -@@ -221,10 +221,6 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL C - prepend_cflags_if_supported_remove_unsupported(-Wcast-align) - endif () - --## always want these --set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") --set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") -- - # pick language dialect - set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") - check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11) diff --git a/drop-sysctl_h.patch b/drop-sysctl_h.patch deleted file mode 100644 index ea8d413..0000000 --- a/drop-sysctl_h.patch +++ /dev/null @@ -1,184 +0,0 @@ -diff -ur percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/arc4random.c percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/arc4random.c ---- percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/arc4random.c 2021-11-25 02:40:14.583485712 +0100 -+++ percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/arc4random.c 2021-11-25 02:42:18.732780086 +0100 -@@ -60,9 +60,6 @@ - #include - #include - #include --#ifdef EVENT__HAVE_SYS_SYSCTL_H --#include --#endif - #endif - #include - #include -diff -ur percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt ---- percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt 2021-11-25 02:40:14.582485710 +0100 -+++ percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt 2021-11-25 02:43:37.682967284 +0100 -@@ -436,7 +436,6 @@ - CHECK_INCLUDE_FILE(netinet/tcp.h EVENT__HAVE_NETINET_TCP_H) - CHECK_INCLUDE_FILE(sys/wait.h EVENT__HAVE_SYS_WAIT_H) - CHECK_INCLUDE_FILE(sys/resource.h EVENT__HAVE_SYS_RESOURCE_H) --CHECK_INCLUDE_FILE(sys/sysctl.h EVENT__HAVE_SYS_SYSCTL_H) - CHECK_INCLUDE_FILE(sys/timerfd.h EVENT__HAVE_SYS_TIMERFD_H) - CHECK_INCLUDE_FILE(errno.h EVENT__HAVE_ERRNO_H) - -@@ -580,10 +579,6 @@ - CHECK_SYMBOL_EXISTS("__FUNCTION__" "" EVENT__HAVE___FUNCTION__) - - CHECK_SYMBOL_EXISTS(TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH) --CHECK_CONST_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN) --CHECK_CONST_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND) --CHECK_CONST_EXISTS(KERN_RANDOM sys/sysctl.h EVENT__HAVE_DECL_KERN_RANDOM) --CHECK_CONST_EXISTS(RANDOM_UUID sys/sysctl.h EVENT__HAVE_DECL_RANDOM_UUID) - CHECK_SYMBOL_EXISTS(F_SETFD fcntl.h EVENT__HAVE_SETFD) - - CHECK_TYPE_SIZE(fd_mask EVENT__HAVE_FD_MASK) -diff -ur percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/event-config.h.cmake percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/event-config.h.cmake ---- percona-server-5.7.35-38.orig/extra/libevent/libevent-2.1.11-stable/event-config.h.cmake 2021-11-25 02:40:14.584485715 +0100 -+++ percona-server-5.7.35-38/extra/libevent/libevent-2.1.11-stable/event-config.h.cmake 2021-11-25 02:43:55.547009642 +0100 -@@ -367,9 +367,6 @@ - /* Define to 1 if you have the header file. */ - #cmakedefine EVENT__HAVE_SYS_STAT_H 1 - --/* Define to 1 if you have the header file. */ --#cmakedefine EVENT__HAVE_SYS_SYSCTL_H 1 -- - /* Define to 1 if you have the header file. */ - #cmakedefine EVENT__HAVE_SYS_TIMERFD_H 1 - -diff -ur percona-server-5.7.35-38.orig/mysys/my_gethwaddr.c percona-server-5.7.35-38/mysys/my_gethwaddr.c ---- percona-server-5.7.35-38.orig/mysys/my_gethwaddr.c 2021-11-25 02:40:16.802490974 +0100 -+++ percona-server-5.7.35-38/mysys/my_gethwaddr.c 2021-11-25 02:41:02.815600077 +0100 -@@ -37,7 +37,6 @@ - #ifdef __FreeBSD__ - - #include --#include - #include - #include - #include -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake percona-server-5.7.35-38/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake 2021-11-25 02:40:20.529499811 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake 2021-11-25 02:41:02.824600099 +0100 -@@ -39,7 +39,6 @@ - check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H) - check_include_files(sys/statvfs.h HAVE_SYS_STATVFS_H) - check_include_files(sys/syscall.h HAVE_SYS_SYSCALL_H) --check_include_files(sys/sysctl.h HAVE_SYS_SYSCTL_H) - check_include_files(sys/syslimits.h HAVE_SYS_SYSLIMITS_H) - check_include_files(sys/time.h HAVE_SYS_TIME_H) - check_include_files(unistd.h HAVE_UNISTD_H) -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/portability/portability.cc percona-server-5.7.35-38/storage/tokudb/PerconaFT/portability/portability.cc ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/portability/portability.cc 2021-11-25 02:40:20.665500134 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/portability/portability.cc 2021-11-25 02:46:09.913328241 +0100 -@@ -60,9 +60,6 @@ - #if defined(HAVE_SYS_SYSCALL_H) - # include - #endif --#if defined(HAVE_SYS_SYSCTL_H) && !defined(_SC_PHYS_PAGES) --# include --#endif - #if defined(HAVE_PTHREAD_NP_H) - # include - #endif -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/config.h.in percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/config.h.in ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/config.h.in 2021-11-25 02:40:21.001500930 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/config.h.in 2021-11-25 02:42:31.834811153 +0100 -@@ -231,9 +231,6 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_SYS_STAT_H - --/* Define to 1 if you have the header file. */ --#undef HAVE_SYS_SYSCTL_H -- - /* Define to 1 if you have the header file. */ - #undef HAVE_SYS_TIME_H - -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure 2021-11-25 02:40:21.017500968 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure 2021-11-25 02:42:31.837811159 +0100 -@@ -16181,7 +16181,7 @@ - - - --for ac_header in sys/param.h sys/sysctl.h byteswap.h -+for ac_header in sys/param.h byteswap.h - do - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -@@ -19545,7 +19545,6 @@ - #ifdef HAVE_SYS_PARAM_H - # include - #endif --#include - int - main(void) - { -@@ -19723,7 +19722,6 @@ - #ifdef HAVE_SYS_PARAM_H - # include - #endif --#include - int - main(void) - { -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac 2021-11-25 02:40:21.017500968 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac 2021-11-25 02:42:31.837811159 +0100 -@@ -476,7 +476,7 @@ - [AC_MSG_ERROR([Required header file(s) are missing.])]) - - # If any of these headers are missing, things should still work correctly: --AC_CHECK_HEADERS([sys/param.h sys/sysctl.h byteswap.h], -+AC_CHECK_HEADERS([sys/param.h byteswap.h], - [], [], [ - #ifdef HAVE_SYS_PARAM_H - # include -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_cpucores.m4 percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_cpucores.m4 ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_cpucores.m4 2021-11-25 02:40:20.936500776 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_cpucores.m4 2021-11-25 02:42:31.838811162 +0100 -@@ -36,7 +36,6 @@ - #ifdef HAVE_SYS_PARAM_H - # include - #endif --#include - int - main(void) - { -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_physmem.m4 percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_physmem.m4 ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_physmem.m4 2021-11-25 02:40:20.936500776 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/m4/lc_physmem.m4 2021-11-25 02:42:31.838811162 +0100 -@@ -38,7 +38,6 @@ - #ifdef HAVE_SYS_PARAM_H - # include - #endif --#include - int - main(void) - { -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/cpucores.h percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/cpucores.h ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/cpucores.h 2021-11-25 02:40:20.948500805 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/cpucores.h 2021-11-25 02:42:31.838811162 +0100 -@@ -22,9 +22,6 @@ - # ifdef HAVE_SYS_PARAM_H - # include - # endif --# ifdef HAVE_SYS_SYSCTL_H --# include --# endif - #endif - - -diff -ur percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/physmem.h percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/physmem.h ---- percona-server-5.7.35-38.orig/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/physmem.h 2021-11-25 02:40:20.948500805 +0100 -+++ percona-server-5.7.35-38/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/common/physmem.h 2021-11-25 02:42:31.838811162 +0100 -@@ -31,9 +31,6 @@ - # ifdef HAVE_SYS_PARAM_H - # include - # endif --# ifdef HAVE_SYS_SYSCTL_H --# include --# endif - - #elif defined(HAVE_PHYSMEM_SYSINFO) - # include diff --git a/mysql-5.7-sphinx.patch b/mysql-5.7-sphinx.patch index 2f558da..a47ed9d 100644 --- a/mysql-5.7-sphinx.patch +++ b/mysql-5.7-sphinx.patch @@ -1,11 +1,22 @@ -diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-server-5.7.35-38/storage/sphinx/ha_sphinx.cc ---- percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc 2021-11-24 19:47:23.900607509 +0100 -+++ percona-server-5.7.35-38/storage/sphinx/ha_sphinx.cc 2021-11-24 19:47:54.875680910 +0100 +From d4273a352d22e8c5e924bc4fd094fc7d9f8e047f Mon Sep 17 00:00:00 2001 +From: riden +Date: Thu, 26 Nov 2015 03:51:40 +0200 +Subject: [PATCH] MySQLSE MySQL 5.7 support + +--- + mysqlse/ha_sphinx.cc | 66 ++++++++++++++++++++++++++++++++++++++----------- + mysqlse/snippets_udf.cc | 22 +++++++++++++---- + 2 files changed, 68 insertions(+), 20 deletions(-) + +diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc +index 8eabe87..e6a49a8 100644 +--- a/storage/sphinx/ha_sphinx.cc ++++ b/storage/sphinx/ha_sphinx.cc @@ -34,13 +34,37 @@ #include "../mysql_priv.h" #endif -+#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709 ++#if MYSQL_VERSION_ID>=50709 +#include "item_timefunc.h" +#define sphinx_append push_back +#define sphinx_array std::vector @@ -32,7 +43,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve #ifndef __WIN__ // UNIX-specific - #include -+ #if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709 ++ #if MYSQL_VERSION_ID>=50709 + #include + #else + #include @@ -40,11 +51,11 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve #include #include -@@ -286,6 +310,12 @@ +@@ -286,6 +310,12 @@ inline void SPH_DEBUG ( const char *, ... ) {} #define SafeDelete(_arg) { if ( _arg ) delete ( _arg ); (_arg) = NULL; } #define SafeDeleteArray(_arg) { if ( _arg ) delete [] ( _arg ); (_arg) = NULL; } -+#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709 ++#if MYSQL_VERSION_ID>=50709 +#ifdef __WIN__ +typedef native_mutex_t pthread_mutex_t; +#endif @@ -53,7 +64,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve ////////////////////////////////////////////////////////////////////////////// /// per-table structure that will be shared among all open Sphinx SE handlers -@@ -602,10 +632,10 @@ +@@ -602,10 +632,10 @@ struct CSphSEQuery }; char * m_sName; ///< points to query buffer int m_iType; @@ -67,24 +78,11 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve public: char m_sParseError[256]; -@@ -634,10 +664,10 @@ - void SendString ( const char * v ) { int iLen = strlen(v); SendDword(iLen); SendBytes ( v, iLen ); } - void SendFloat ( float v ) { SendDword ( sphF2DW(v) ); } - }; -- -+#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION - template int CSphSEQuery::ParseArray ( uint32 **, const char * ); - template int CSphSEQuery::ParseArray ( longlong **, const char * ); -- -+#endif - ////////////////////////////////////////////////////////////////////////////// - - #if MYSQL_VERSION_ID>50100 -@@ -733,13 +763,21 @@ +@@ -733,9 +763,13 @@ static int sphinx_init_func ( void * p ) { sphinx_init = 1; void ( pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST ) ); -+ #if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 ++ #if MYSQL_VERSION_ID >= 50709 + sphinx_hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0, + sphinx_get_key, 0, 0, 0 ); + #else @@ -95,32 +93,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve #if MYSQL_VERSION_ID > 50100 handlerton * hton = (handlerton*) p; hton->state = SHOW_OPTION_YES; -+ #if !defined(MARIADB_BASE_VERSION) - hton->db_type = DB_TYPE_FIRST_DYNAMIC; -+ #else -+ hton->db_type = DB_TYPE_AUTOASSIGN; -+ #endif - hton->create = sphinx_create_handler; - hton->close_connection = sphinx_close_connection; - hton->show_status = sphinx_show_status; -@@ -855,10 +893,15 @@ - SPH_RET(TRUE); - } - CSphTLS * pTls = (CSphTLS*) thd->ha_data[sphinx_hton.slot]; -- -+ #ifndef MARIADB_BASE_VERSION - field_list.push_back ( new Item_empty_string ( "Type", 10 ) ); - field_list.push_back ( new Item_empty_string ( "Name", FN_REFLEN ) ); - field_list.push_back ( new Item_empty_string ( "Status", 10 ) ); -+ #else -+ field_list.push_back ( new Item_empty_string ( thd, "Type", 10 ) ); -+ field_list.push_back ( new Item_empty_string ( thd, "Name", FN_REFLEN ) ); -+ field_list.push_back ( new Item_empty_string ( thd, "Status", 10 ) ); -+ #endif - if ( protocol->send_fields ( &field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF ) ) - SPH_RET(TRUE); - -@@ -1321,7 +1364,7 @@ +@@ -1321,7 +1355,7 @@ CSphSEQuery::~CSphSEQuery () SafeDeleteArray ( m_sQueryBuffer ); SafeDeleteArray ( m_pWeights ); SafeDeleteArray ( m_pBuf ); @@ -129,32 +102,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve SafeDelete ( m_dOverrides.at(i) ); SPH_VOID_RET(); } -@@ -1412,6 +1455,15 @@ - return c=='@'; - } - -+static bool myisjson ( char c ) -+{ -+ return -+ c=='.' || -+ c=='[' || -+ c==']'; -+} -+ -+ - - bool CSphSEQuery::ParseField ( char * sField ) - { -@@ -1623,7 +1675,7 @@ - break; - - tFilter.m_sAttrName = sValue; -- while ( (*sValue) && ( myisattr(*sValue) || myismagic(*sValue) ) ) -+ while ( (*sValue) && ( myisattr(*sValue) || myismagic(*sValue) ) || myisjson(*sValue) ) - sValue++; - if ( !*sValue ) - break; -@@ -1789,7 +1841,7 @@ +@@ -1789,7 +1823,7 @@ bool CSphSEQuery::ParseField ( char * sField ) pOverride = new CSphSEQuery::Override_t; pOverride->m_sName = chop(sName); pOverride->m_iType = iType; @@ -163,7 +111,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve } ulonglong uId = strtoull ( sId, NULL, 10 ); -@@ -1801,8 +1853,8 @@ +@@ -1801,8 +1835,8 @@ bool CSphSEQuery::ParseField ( char * sField ) else tValue.m_uValue = (uint32)strtoul ( sValue, NULL, 10 ); @@ -174,7 +122,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve } if ( !pOverride ) -@@ -1906,11 +1958,11 @@ +@@ -1906,11 +1940,11 @@ int CSphSEQuery::BuildRequest ( char ** ppBuffer ) iReqSize += 8 + strlen(m_sFieldWeight[i] ); // overrides iReqSize += 4; @@ -188,7 +136,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve } // select iReqSize += 4; -@@ -2012,14 +2064,14 @@ +@@ -2012,14 +2046,14 @@ int CSphSEQuery::BuildRequest ( char ** ppBuffer ) SendString ( m_sComment ); // overrides @@ -207,19 +155,7 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve { SendUint64 ( pOverride->m_dIds.at(j) ); if ( pOverride->m_iType==SPH_ATTR_FLOAT ) -@@ -2045,9 +2097,9 @@ - ////////////////////////////////////////////////////////////////////////////// - // SPHINX HANDLER - ////////////////////////////////////////////////////////////////////////////// -- -+#ifndef MARIADB_BASE_VERSION - static const char * ha_sphinx_exts[] = { NullS }; -- -+#endif - - #if MYSQL_VERSION_ID<50100 - ha_sphinx::ha_sphinx ( TABLE_ARG * table ) -@@ -2073,8 +2125,10 @@ +@@ -2073,8 +2107,10 @@ ha_sphinx::ha_sphinx ( handlerton * hton, TABLE_ARG * table ) , m_dUnboundFields ( NULL ) { SPH_ENTER_METHOD(); @@ -230,202 +166,69 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.cc percona-serve SPH_VOID_RET(); } -@@ -2082,11 +2136,24 @@ - // If frm_error() is called then we will use this to to find out what file extentions - // exist for the storage engine. This is also used by the default rename_table and - // delete_table method in handler.cc. -+#ifndef MARIADB_BASE_VERSION - const char ** ha_sphinx::bas_ext() const - { - return ha_sphinx_exts; - } -- -+#else -+ha_sphinx::~ha_sphinx() -+{ -+ SafeDeleteArray ( m_dAttrs ); -+ SafeDeleteArray ( m_dUnboundFields ); -+ if ( m_dFields ) -+ { -+ for (uint32 i=0; i< m_iFields; i++ ) -+ SafeDeleteArray ( m_dFields[i] ); -+ delete [] m_dFields; -+ } -+} -+#endif - - // Used for opening tables. The name will be the name of the file. - // A table is opened when it needs to be opened. For instance -@@ -2349,11 +2416,19 @@ - sQuery.append ( "''" ); - - } else -- { -+ { -+ #if MYSQL_VERSION_ID>=100000 -+ THD *thd= ha_thd(); -+ #endif - if ( (*ppField)->type()==MYSQL_TYPE_TIMESTAMP ) - { -- Item_field * pWrap = new Item_field ( *ppField ); // autofreed by query arena, I assume -- Item_func_unix_timestamp * pConv = new Item_func_unix_timestamp ( pWrap ); -+ #if MYSQL_VERSION_ID>=100000 -+ Item_field * pWrap = new (thd->mem_root) Item_field(thd, *ppField); // autofreed by query arena, I assume -+ Item_func_unix_timestamp * pConv = new (thd->mem_root) Item_func_unix_timestamp(thd, pWrap); -+ #else -+ Item_field * pWrap = new Item_field ( *ppField ); // autofreed by query arena, I assume -+ Item_func_unix_timestamp * pConv = new Item_func_unix_timestamp ( pWrap ); -+ #endif - pConv->quick_fix_field(); - unsigned int uTs = (unsigned int) pConv->val_int(); +diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc +index d0899e8..e9f7bc0 100644 +--- a/storage/sphinx/snippets_udf.cc ++++ b/storage/sphinx/snippets_udf.cc +@@ -17,13 +17,16 @@ + #include + #include -@@ -2390,7 +2465,10 @@ +-#ifndef __WIN__ ++#include ++ ++#ifndef _WIN32 ++#if MYSQL_VERSION_ID>=50709 ++#include ++#endif + #include + #include + #endif - unsigned int uTimeout = 1; - mysql_options ( pConn, MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&uTimeout ); +-#include - -+ #ifdef MARIADB_BASE_VERSION -+ my_bool my_true= 1; -+ mysql_options(pConn, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, (char*) &my_true); -+ #endif - if ( !mysql_real_connect ( pConn, m_pShare->m_sHost, "root", "", "", m_pShare->m_iPort, m_pShare->m_sSocket, 0 ) ) - SPH_RET ( HandleMysqlError ( pConn, ER_CONNECT_TO_FOREIGN_DATA_SOURCE ) ); - -@@ -2449,6 +2527,10 @@ - - unsigned int uTimeout = 1; - mysql_options ( pConn, MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&uTimeout ); -+ #ifdef MARIADB_BASE_VERSION -+ my_bool my_true= 1; -+ mysql_options(pConn, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, (char*) &my_true); -+ #endif - - if ( !mysql_real_connect ( pConn, m_pShare->m_sHost, "root", "", "", m_pShare->m_iPort, m_pShare->m_sSocket, 0 ) ) - SPH_RET ( HandleMysqlError ( pConn, ER_CONNECT_TO_FOREIGN_DATA_SOURCE ) ); -@@ -2756,11 +2838,19 @@ - break; - - // copy the query, and let know that we intercepted this condition -- Item_string * pString = (Item_string *) args[1]; -- pTable->m_bQuery = true; -+ #if MYSQL_VERSION_ID>=100000 -+ String *pString= args[1]->val_str(NULL); -+ pTable->m_bQuery = true; -+ strncpy ( pTable->m_sQuery, pString->c_ptr(), sizeof(pTable->m_sQuery) ); -+ pTable->m_sQuery[sizeof(pTable->m_sQuery)-1] = '\0'; -+ pTable->m_pQueryCharset = pString->charset(); -+ #else -+ Item_string * pString = (Item_string *) args[1]; -+ pTable->m_bQuery = true; - strncpy ( pTable->m_sQuery, pString->str_value.c_ptr(), sizeof(pTable->m_sQuery) ); - pTable->m_sQuery[sizeof(pTable->m_sQuery)-1] = '\0'; - pTable->m_pQueryCharset = pString->str_value.charset(); -+ #endif - - } else - { -@@ -3540,7 +3630,7 @@ + #if MYSQL_VERSION_ID>=50515 + #include "sql_class.h" + #include "sql_array.h" +@@ -34,6 +37,13 @@ + #include "../mysql_priv.h" #endif - out->type = SHOW_CHAR; -- out->value = ""; -+ out->value = ""; - return 0; - } ++#ifdef _WIN32 ++#if MYSQL_VERSION_ID>=50709 ++#define in_addr_t uint32 ++#include ++#endif ++#endif ++ + #include + #include -@@ -3673,7 +3763,25 @@ - {0, 0, (enum_mysql_show_type)0} - }; +@@ -90,7 +100,9 @@ void sphUnalignedWrite ( void * pPtr, const T & tVal ) -- -+#ifdef MARIADB_BASE_VERSION -+maria_declare_plugin(sphinx) -+{ -+ MYSQL_STORAGE_ENGINE_PLUGIN, -+ &sphinx_storage_engine, -+ sphinx_hton_name, -+ "Sphinx developers", -+ sphinx_hton_comment, -+ PLUGIN_LICENSE_GPL, -+ sphinx_init_func, // Plugin Init -+ sphinx_done_func, // Plugin Deinit -+ 0x0202, // 2.2 -+ sphinx_status_vars, -+ NULL, -+ SPHINXSE_VERSION, // string version -+MariaDB_PLUGIN_MATURITY_GAMMA -+} -+maria_declare_plugin_end; -+#else - mysql_declare_plugin(sphinx) - { - MYSQL_STORAGE_ENGINE_PLUGIN, -@@ -3690,7 +3798,7 @@ - NULL - } - mysql_declare_plugin_end; -- -+#endif - #endif // >50100 + #define Min(a,b) ((a)<(b)?(a):(b)) - // -diff -ur percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.h percona-server-5.7.35-38/storage/sphinx/ha_sphinx.h ---- percona-server-5.7.35-38.orig/storage/sphinx/ha_sphinx.h 2021-11-24 19:47:23.900607509 +0100 -+++ percona-server-5.7.35-38/storage/sphinx/ha_sphinx.h 2021-11-24 19:47:55.056681337 +0100 -@@ -53,14 +53,24 @@ - #else - ha_sphinx ( handlerton * hton, TABLE_ARG * table_arg ); - #endif -- ~ha_sphinx () {} -+#ifndef MARIADB_BASE_VERSION -+ ~ha_sphinx (){} -+#else -+ ~ha_sphinx (); ++#if !defined(_WIN32) + typedef unsigned int DWORD; +#endif - const char * table_type () const { return "SPHINX"; } ///< SE name for display purposes - const char * index_type ( uint ) { return "HASH"; } ///< index type name for display purposes -- const char ** bas_ext () const; ///< my file extensions -- -+ #ifndef MARIADB_BASE_VERSION -+ const char ** bas_ext () const; -+ #endif - #if MYSQL_VERSION_ID>50100 -- ulonglong table_flags () const { return HA_CAN_INDEX_BLOBS; } ///< bitmap of implemented flags (see handler.h for more info) -+ #ifdef MARIADB_BASE_VERSION -+ ulonglong table_flags () const { return HA_CAN_INDEX_BLOBS | -+ HA_CAN_TABLE_CONDITION_PUSHDOWN; } ///< bitmap of implemented flags (see handler.h for more info) -+ #else -+ ulonglong table_flags () const { return HA_CAN_INDEX_BLOBS; } -+ #endif - #else - ulong table_flags () const { return HA_CAN_INDEX_BLOBS; } ///< bitmap of implemented flags (see handler.h for more info) - #endif -@@ -77,8 +87,12 @@ - #else - virtual double scan_time () { return (double)( records+deleted )/20.0 + 10; } ///< called in test_quick_select to determine if indexes should be used - #endif -- -- virtual double read_time ( ha_rows rows ) { return (double)rows/20.0 + 1; } ///< index read time estimate -+ #ifdef MARIADB_BASE_VERSION -+ virtual double read_time(uint index, uint ranges, ha_rows rows) -+ { return ranges + (double)rows/20.0 + 1; } ///< index read time estimate -+ #else -+ virtual double read_time ( ha_rows rows ) { return (double)rows/20.0 + 1; } -+ #endif + inline DWORD sphF2DW ( float f ) { union { float f; uint32 d; } u; u.f = f; return u.d; } - public: - int open ( const char * name, int mode, uint test_if_locked ); -diff -ur percona-server-5.7.35-38.orig/storage/sphinx/snippets_udf.cc percona-server-5.7.35-38/storage/sphinx/snippets_udf.cc ---- percona-server-5.7.35-38.orig/storage/sphinx/snippets_udf.cc 2021-11-24 19:47:23.900607509 +0100 -+++ percona-server-5.7.35-38/storage/sphinx/snippets_udf.cc 2021-11-24 19:47:55.056681337 +0100 -@@ -34,6 +34,9 @@ - #include "../mysql_priv.h" +@@ -359,7 +371,7 @@ bool CSphUrl::Parse ( const char * sUrl, int iLen ) + int CSphUrl::Connect() + { + struct sockaddr_in sin; +-#ifndef __WIN__ ++#ifndef _WIN32 + struct sockaddr_un saun; #endif -+#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709 -+ #include -+#endif - #include - #include - +@@ -426,7 +438,7 @@ int CSphUrl::Connect() + } + } else + { +-#ifndef __WIN__ ++#ifndef _WIN32 + iDomain = AF_UNIX; + iSockaddrSize = sizeof(saun); + pSockaddr = (struct sockaddr *) &saun; diff --git a/mysql-chain-certs.patch b/mysql-chain-certs.patch deleted file mode 100644 index 36c1cd3..0000000 --- a/mysql-chain-certs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur percona-server-5.7.35-38.orig/vio/viosslfactories.c percona-server-5.7.35-38/vio/viosslfactories.c ---- percona-server-5.7.35-38.orig/vio/viosslfactories.c 2021-11-24 19:48:22.417746172 +0100 -+++ percona-server-5.7.35-38/vio/viosslfactories.c 2021-11-24 19:48:50.473812651 +0100 -@@ -200,7 +200,7 @@ - key_file= cert_file; - - if (cert_file && -- SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0) -+ SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0) - { - *error= SSL_INITERR_CERT; - DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file)); diff --git a/mysql-clusters.conf b/mysql-clusters.conf index c617647..02d9beb 100644 --- a/mysql-clusters.conf +++ b/mysql-clusters.conf @@ -7,4 +7,4 @@ # /config/location.conf=/cluster/directory # If you give config name without path it defaults to /etc/mysql/ -mysqld.conf=/var/lib/mysql +mysqld.conf=/var/lib/mysql{MYSQL_MAJOR}/01 diff --git a/mysql-cmake.patch b/mysql-cmake.patch index b26722a..b22b2f1 100644 --- a/mysql-cmake.patch +++ b/mysql-cmake.patch @@ -1,7 +1,7 @@ -diff -ur percona-server-5.7.35-38.orig/cmake/readline.cmake percona-server-5.7.35-38/cmake/readline.cmake ---- percona-server-5.7.35-38.orig/cmake/readline.cmake 2021-11-24 19:49:56.851969940 +0100 -+++ percona-server-5.7.35-38/cmake/readline.cmake 2021-11-24 19:50:52.286101293 +0100 -@@ -110,23 +110,23 @@ +diff -ruN mysql-5.7.21.orig/cmake/readline.cmake mysql-5.7.21/cmake/readline.cmake +--- mysql-5.7.21.orig/cmake/readline.cmake 2017-12-28 04:46:26.000000000 +0100 ++++ mysql-5.7.21/cmake/readline.cmake 2018-03-31 21:17:28.373826351 +0200 +@@ -110,23 +110,23 @@ ENDMACRO() MACRO (FIND_SYSTEM_EDITLINE) FIND_PATH(FOUND_EDITLINE_READLINE @@ -29,7 +29,7 @@ diff -ur percona-server-5.7.35-38.orig/cmake/readline.cmake percona-server-5.7.3 ) MARK_AS_ADVANCED(EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY) -@@ -141,7 +141,7 @@ +@@ -139,7 +139,7 @@ MACRO (FIND_SYSTEM_EDITLINE) LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${EDITLINE_LIBRARY}) CHECK_CXX_SOURCE_COMPILES(" #include @@ -38,7 +38,7 @@ diff -ur percona-server-5.7.35-38.orig/cmake/readline.cmake percona-server-5.7.3 int main(int argc, char **argv) { HIST_ENTRY entry; -@@ -151,14 +151,13 @@ +@@ -149,14 +149,13 @@ MACRO (FIND_SYSTEM_EDITLINE) CHECK_CXX_SOURCE_COMPILES(" #include @@ -56,5 +56,25 @@ diff -ur percona-server-5.7.35-38.orig/cmake/readline.cmake percona-server-5.7.3 + rl_completion_matches(0,0); + return res ? 0 : 1; }" - XLINE_HAVE_COMPLETION_INT) + EDITLINE_HAVE_COMPLETION_INT) +@@ -168,7 +167,7 @@ MACRO (FIND_SYSTEM_EDITLINE) + typedef char* MYFunction(const char*, int); + MYFunction* myf= rl_completion_entry_function; + char *res= (myf)(NULL, 0); +- completion_matches(0,0); ++ rl_completion_matches(0,0); + return res != NULL; + }" + EDITLINE_HAVE_COMPLETION_CHAR) +--- mysql-8.1.0/CMakeLists.txt~ 2023-06-21 09:52:10.000000000 +0200 ++++ mysql-8.1.0/CMakeLists.txt 2023-10-20 10:08:46.673284042 +0200 +@@ -20,6 +20,8 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + ++variable_watch(CMAKE_EXECUTABLE_SUFFIX) ++ + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") + + IF(WIN32) diff --git a/mysql-dubious-exports.patch b/mysql-dubious-exports.patch deleted file mode 100644 index a928927..0000000 --- a/mysql-dubious-exports.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -ur percona-server-5.7.35-38.orig/include/m_string.h percona-server-5.7.35-38/include/m_string.h ---- percona-server-5.7.35-38.orig/include/m_string.h 2021-11-24 19:49:05.797848959 +0100 -+++ percona-server-5.7.35-38/include/m_string.h 2021-11-24 19:49:38.519926500 +0100 -@@ -193,6 +193,7 @@ - extern size_t strnlen(const char *s, size_t n); - #endif - -+#define is_prefix mysql_is_prefix /* namespace sanity */ - extern int is_prefix(const char *, const char *); - - /* Conversion routines */ -diff -ur percona-server-5.7.35-38.orig/include/mysql_com.h percona-server-5.7.35-38/include/mysql_com.h ---- percona-server-5.7.35-38.orig/include/mysql_com.h 2021-11-24 19:49:05.801848968 +0100 -+++ percona-server-5.7.35-38/include/mysql_com.h 2021-11-24 19:49:38.553926581 +0100 -@@ -522,6 +522,7 @@ - void net_end(NET *net); - void net_clear(NET *net, my_bool check_buffer); - void net_claim_memory_ownership(NET *net); -+#define net_realloc mysql_net_realloc /* namespace sanity */ - my_bool net_realloc(NET *net, size_t length); - my_bool net_flush(NET *net); - my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); -diff -ur percona-server-5.7.35-38.orig/include/mysql.h.pp percona-server-5.7.35-38/include/mysql.h.pp ---- percona-server-5.7.35-38.orig/include/mysql.h.pp 2021-11-24 19:49:05.799848964 +0100 -+++ percona-server-5.7.35-38/include/mysql.h.pp 2021-11-24 19:49:38.552926579 +0100 -@@ -128,7 +128,7 @@ - void net_end(NET *net); - void net_clear(NET *net, my_bool check_buffer); - void net_claim_memory_ownership(NET *net); --my_bool net_realloc(NET *net, size_t length); -+my_bool mysql_net_realloc(NET *net, size_t length); - my_bool net_flush(NET *net); - my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); - my_bool net_write_command(NET *net,unsigned char command, -diff -ur percona-server-5.7.35-38.orig/include/my_sys.h percona-server-5.7.35-38/include/my_sys.h ---- percona-server-5.7.35-38.orig/include/my_sys.h 2021-11-24 19:49:05.798848961 +0100 -+++ percona-server-5.7.35-38/include/my_sys.h 2021-11-24 19:49:38.552926579 +0100 -@@ -261,6 +261,7 @@ - - /* charsets */ - #define MY_ALL_CHARSETS_SIZE 2048 -+#define default_charset_info mysql_default_charset_info /* namespace sanity */ - extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; - extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]; - extern CHARSET_INFO compiled_charsets[]; -@@ -999,6 +1000,9 @@ - extern uint get_collation_number(const char *name); - extern const char *get_charset_name(uint cs_number); - -+#define get_charset mysql_get_charset /* namespace sanity */ -+#define get_charset_by_csname mysql_get_charset_by_csname -+ - extern CHARSET_INFO *get_charset(uint cs_number, myf flags); - extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); - extern CHARSET_INFO *my_collation_get_by_name(MY_CHARSET_LOADER *loader, diff --git a/mysql-opt.patch b/mysql-opt.patch index 766dda8..b48ce5d 100644 --- a/mysql-opt.patch +++ b/mysql-opt.patch @@ -1,45 +1,57 @@ -diff -ur percona-server-5.7.35-38.orig/cmake/build_configurations/compiler_options.cmake percona-server-5.7.35-38/cmake/build_configurations/compiler_options.cmake ---- percona-server-5.7.35-38.orig/cmake/build_configurations/compiler_options.cmake 2021-11-24 18:56:51.570445147 +0100 -+++ percona-server-5.7.35-38/cmake/build_configurations/compiler_options.cmake 2021-11-24 19:35:58.389983145 +0100 -@@ -32,17 +32,17 @@ - SET(64BIT 1) - ENDIF() - --SET(CMAKE_CXX_STANDARD 98) -+SET(CMAKE_CXX_STANDARD 11) - - # Compiler options - IF(UNIX) -- MY_CHECK_CXX_COMPILER_FLAG("-std=gnu++03" GNU03_SUPPORTED) -+ MY_CHECK_CXX_COMPILER_FLAG("-std=gnu++11" GNU11_SUPPORTED) - -- IF(GNU03_SUPPORTED) -+ IF(GNU11_SUPPORTED) - IF(CMAKE_VERSION VERSION_LESS 3.1.0) -- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++03") -+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") - ELSE() -- SET(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -std=gnu++03) -+ SET(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -std=gnu++11) +--- mysql-5.7.27/cmake/build_configurations/compiler_options.cmake.orig 2019-06-10 16:43:20.000000000 +0200 ++++ mysql-5.7.27/cmake/build_configurations/compiler_options.cmake 2019-07-29 05:55:55.892824445 +0200 +@@ -50,8 +50,8 @@ + IF(C_NO_EXPENSIVE_OPTIMIZATIONS) + SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -fno-expensive-optimizations") + ENDIF() +- SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") +- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") ++ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMMON_C_FLAGS}") ++ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(COMMON_CXX_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") +@@ -59,7 +59,7 @@ + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GXX_VERSION) + IF(GXX_VERSION VERSION_EQUAL 6.0 OR GXX_VERSION VERSION_GREATER 6.0) +- SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=gnu++03") ++ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=gnu++11") ENDIF() + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) +@@ -80,15 +80,15 @@ + IF(CXX_NO_EXPENSIVE_OPTIMIZATIONS) + SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -fno-expensive-optimizations") + ENDIF() +- SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") +- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ++ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}") ++ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}") ENDIF() -@@ -166,13 +166,13 @@ + # Default Clang flags + IF(CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") +- SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") +- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") ++ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMMON_C_FLAGS}") ++ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") +@@ -95,11 +95,11 @@ + IF(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0 OR + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") +- SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=gnu++03") ++ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=gnu++11") ENDIF() + ENDIF() +- SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") +- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ++ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}") ++ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}") + ENDIF() - SET(COMMON_C_FLAGS "-g ${SUNPRO_FLAGS}") -- SET(COMMON_CXX_FLAGS "-g0 ${SUNPRO_FLAGS} -std=c++03") -+ SET(COMMON_CXX_FLAGS "-g0 ${SUNPRO_FLAGS} -std=c++11") - # For SunPro, append our own flags rather than prepending below. - # We need -g0 and the misc -x flags above to reduce the size of binaries. -- STRING_APPEND(CMAKE_C_FLAGS_DEBUG " ${COMMON_C_FLAGS}") -- STRING_APPEND(CMAKE_CXX_FLAGS_DEBUG " ${COMMON_CXX_FLAGS}") -- STRING_APPEND(CMAKE_C_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_C_FLAGS}") -- STRING_APPEND(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_CXX_FLAGS}") -+ STRING_APPEND(CMAKE_C_FLAGS_DEBUG " ${CMAKE_C_FLAGS_DEBUG} ${COMMON_C_FLAGS}") -+ STRING_APPEND(CMAKE_CXX_FLAGS_DEBUG " ${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}") -+ STRING_APPEND(CMAKE_C_FLAGS_RELWITHDEBINFO " -O3 -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMMON_C_FLAGS}") -+ STRING_APPEND(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -O3 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}") - STRING_APPEND(CMAKE_C_FLAGS_RELEASE " -xO3 ${COMMON_C_FLAGS}") - STRING_APPEND(CMAKE_CXX_FLAGS_RELEASE " -xO3 ${COMMON_CXX_FLAGS}") - STRING_APPEND(CMAKE_C_FLAGS_MINSIZEREL " -xO3 ${COMMON_C_FLAGS}") + # Solaris flags diff --git a/mysql-protobuf.patch b/mysql-protobuf.patch deleted file mode 100644 index 6e85914..0000000 --- a/mysql-protobuf.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur percona-server-5.7.35-38.orig/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h percona-server-5.7.35-38/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h ---- percona-server-5.7.35-38.orig/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h 2021-11-24 19:41:59.748839411 +0100 -+++ percona-server-5.7.35-38/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h 2021-11-24 19:43:50.561101985 +0100 -@@ -36,7 +36,9 @@ - #include - #include - #include -+#if GOOGLE_PROTOBUF_VERSION < 3008000 - #include -+#endif - #include - - #include "mysqlx_connection.pb.h" diff --git a/mysql-readline.patch b/mysql-readline.patch new file mode 100644 index 0000000..ca2af06 --- /dev/null +++ b/mysql-readline.patch @@ -0,0 +1,33 @@ +--- mysql-8.0.20/client/mysql.cc~ 2020-05-12 19:39:17.000000000 +0200 ++++ mysql-8.0.20/client/mysql.cc 2020-05-12 19:49:31.903300850 +0200 +@@ -79,6 +79,7 @@ + #define LOG_USER 0 + #else + #include ++#include + #include + + #define HAVE_READLINE +@@ -1134,22 +1134,6 @@ static COMMANDS commands[] = { + static const char *load_default_groups[] = {"mysql", "client", nullptr}; + + #ifdef HAVE_READLINE +-/* +- HIST_ENTRY is defined for libedit, but not for the real readline +- Need to redefine it for real readline to find it +-*/ +-#if !defined(HAVE_HIST_ENTRY) +-typedef struct _hist_entry { +- const char *line; +- const char *data; +-} HIST_ENTRY; +-#endif +- +-extern "C" int add_history(const char *command); /* From readline directory */ +-extern "C" int read_history(const char *command); +-extern "C" int write_history(const char *command); +-extern "C" HIST_ENTRY *history_get(int num); +-extern "C" int history_length; + static int not_in_history(const char *line); + static void initialize_readline(char *name); + #endif /* HAVE_READLINE */ diff --git a/mysql-sphinx.patch b/mysql-sphinx.patch index 26517e4..dac55bd 100644 --- a/mysql-sphinx.patch +++ b/mysql-sphinx.patch @@ -1,7 +1,6 @@ -diff -ur percona-server-5.7.35-38.orig/storage/sphinx/Makefile.am percona-server-5.7.35-38/storage/sphinx/Makefile.am ---- percona-server-5.7.35-38.orig/storage/sphinx/Makefile.am 2016-07-19 12:42:18.000000000 +0200 -+++ percona-server-5.7.35-38/storage/sphinx/Makefile.am 2021-11-24 19:47:02.552556917 +0100 -@@ -31,19 +31,19 @@ +--- mysql-5.1.49/storage/sphinx/Makefile.am~ 2009-02-13 23:26:46.000000000 +0200 ++++ mysql-5.1.49/storage/sphinx/Makefile.am 2010-07-24 16:35:57.568716704 +0300 +@@ -31,7 +31,7 @@ LDADD = DEFS= @DEFS@ \ @@ -10,6 +9,9 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/Makefile.am percona-server noinst_HEADERS = ha_sphinx.h +--- mysql-5.1.49/storage/sphinx/Makefile.am~ 2010-07-24 16:37:48.000000000 +0300 ++++ mysql-5.1.49/storage/sphinx/Makefile.am 2010-07-24 17:00:56.161565823 +0300 +@@ -38,7 +38,7 @@ EXTRA_LTLIBRARIES = ha_sphinx.la pkgplugin_LTLIBRARIES = @plugin_sphinx_shared_target@ sphinx.la @@ -18,6 +20,11 @@ diff -ur percona-server-5.7.35-38.orig/storage/sphinx/Makefile.am percona-server ha_sphinx_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_sphinx_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN ha_sphinx_la_SOURCES = ha_sphinx.cc +--- mysql-5.1.49/storage/sphinx/Makefile.am~ 2010-07-24 19:14:55.000000000 +0300 ++++ mysql-5.1.49/storage/sphinx/Makefile.am 2010-07-25 03:47:56.660771099 +0300 +@@ -43,7 +43,7 @@ + ha_sphinx_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN + ha_sphinx_la_SOURCES = ha_sphinx.cc -sphinx_la_LDFLAGS = -module +sphinx_la_LDFLAGS = -module -avoid-version -rpath $(MYSQLLIBdir) diff --git a/mysql-system-xxhash.patch b/mysql-system-xxhash.patch new file mode 100644 index 0000000..9ca5514 --- /dev/null +++ b/mysql-system-xxhash.patch @@ -0,0 +1,168 @@ +--- mysql-8.0.30/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2022-10-09 14:33:34.598098038 +0200 +@@ -126,7 +126,7 @@ Gcs_sender_id calculate_sender_id(const + std::string info(node.get_member_id().get_member_id()); + info.append(node.get_member_uuid().actual_value); + +- return GCS_XXH64(info.c_str(), info.size(), 0); ++ return XXH64(info.c_str(), info.size(), 0); + } + + bool Gcs_message_stage_split_v2::update_members_information( +--- mysql-8.0.30/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h 2022-10-09 08:41:35.109178797 +0200 +@@ -25,10 +25,6 @@ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-// Define a namespace prefix to all xxhash functions. This is done to +-// avoid conflict with xxhash symbols in liblz4. +-#define XXH_NAMESPACE GCS_ +- +-#include "xxhash.h" ++#include + + #endif // GCS_XXHASH_H_INCLUDED +--- mysql-8.0.30/plugin/group_replication/libmysqlgcs/CMakeLists.txt.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/plugin/group_replication/libmysqlgcs/CMakeLists.txt 2022-10-09 08:42:55.768741827 +0200 +@@ -140,7 +140,6 @@ SET(GCS_SOURCES + src/bindings/xcom/gcs_xcom_statistics_interface.cc + src/bindings/xcom/gcs_xcom_proxy.cc + src/bindings/xcom/gcs_xcom_communication_protocol_changer.cc +- ${BUNDLED_LZ4_PATH}/xxhash.c # required by gcs_message_stage_split + src/bindings/xcom/gcs_message_stage_split.cc + src/bindings/xcom/gcs_xcom_synode.cc + src/bindings/xcom/gcs_xcom_expels_in_progress.cc) +@@ -219,6 +218,7 @@ ADD_LIBRARY(mysqlgcs STATIC ${XCOM_SOURC + # Dependency on mysys from gcs_logging_system.cc + # but pick up symbols from the server: + # TARGET_LINK_LIBRARIES(mysqlgcs mysys) ++TARGET_LINK_LIBRARIES(mysqlgcs xxhash) + + IF(CMAKE_VERSION VERSION_GREATER "3.19" AND NOT APPLE_XCODE) + # New in version 3.19: +--- mysql-8.0.30/sql/CMakeLists.txt.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/sql/CMakeLists.txt 2022-10-09 08:53:20.935355008 +0200 +@@ -755,7 +755,6 @@ SET(SQL_SOURCE + ${CONF_SOURCES} + ${SQL_SHARED_SOURCES} + ${SQL_HEADERS} +- ${BUNDLED_LZ4_PATH}/xxhash.c + ../libmysql/errmsg.cc + ../sql-common/client.cc + ../sql-common/client_plugin.cc +@@ -813,11 +812,6 @@ IF(WIN32) + ) + ENDIF() + +-MY_ADD_COMPILE_DEFINITIONS( +- ${BUNDLED_LZ4_PATH}/xxhash.c +- COMPILE_DEFINITIONS XXH_NAMESPACE=MY_ +- ) +- + # Workaround for Apple Clang bug on ARM. + # When linking mysqld (and executables using server_unittest_library) + # we get linker warnings about +@@ -842,13 +836,6 @@ IF(APPLE_ARM) + ) + ENDIF() + +-ADD_COMPILE_FLAGS( +- ${BUNDLED_LZ4_PATH}/xxhash.c +- iterators/hash_join_iterator.cc +- rpl_write_set_handler.cc +- COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH} +- ) +- + # Fixes "C1128: number of sections exceeded object file format limit" in MSVC + IF(WIN32) + ADD_COMPILE_FLAGS( +@@ -924,7 +911,7 @@ ADD_DEPENDENCIES(sql_main GenBootstrapPr + ADD_DEPENDENCIES(sql_main GenSysSchema) + TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS} + mysql_server_component_services mysys strings vio +- binlogevents_static ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES}) ++ binlogevents_static xxhash ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES}) + + # sql/immutable_string.h uses + # google::protobuf::io::CodedOutputStream::WriteVarint64ToArray +--- mysql-8.0.30/sql/iterators/hash_join_iterator.cc.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/sql/iterators/hash_join_iterator.cc 2022-10-09 17:45:57.618897459 +0200 +@@ -32,7 +32,7 @@ + #include "field_types.h" + #include "my_alloc.h" + #include "my_bit.h" +-#include "my_xxhash.h" ++#include + + #include "my_inttypes.h" + #include "my_sys.h" +@@ -307,7 +307,7 @@ static bool WriteRowToChunk( + const uint64_t join_key_hash = + join_key_and_row_buffer->length() == 0 + ? kZeroKeyLengthHash +- : MY_XXH64(join_key_and_row_buffer->ptr(), ++ : XXH64(join_key_and_row_buffer->ptr(), + join_key_and_row_buffer->length(), xxhash_seed); + + assert((chunks->size() & (chunks->size() - 1)) == 0); +--- mysql-8.0.30/sql/rpl_write_set_handler.cc.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/sql/rpl_write_set_handler.cc 2022-10-09 20:07:41.099496817 +0200 +@@ -37,7 +37,7 @@ + #include "my_dbug.h" + #include "my_inttypes.h" + #include "my_murmur3.h" // murmur3_32 +-#include "my_xxhash.h" // IWYU pragma: keep ++#include + #include "mysql_com.h" + #include "sql-common/json_binary.h" + #include "sql-common/json_dom.h" +@@ -75,7 +75,7 @@ uint64 calc_hash(ulong algorithm, type T + if (algorithm == HASH_ALGORITHM_MURMUR32) + return (murmur3_32((const uchar *)T, len, 0)); + else +- return (MY_XXH64((const uchar *)T, len, 0)); ++ return (XXH64((const uchar *)T, len, 0)); + } + + #ifndef NDEBUG +--- mysql-8.0.30/unittest/gunit/hash_join-t.cc.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/unittest/gunit/hash_join-t.cc 2022-10-09 20:36:43.693389709 +0200 +@@ -28,7 +28,7 @@ + + #include "include/my_murmur3.h" + #include "my_alloc.h" +-#include "my_xxhash.h" ++#include + #include "sql/item_cmpfunc.h" + #include "sql/iterators/hash_join_buffer.h" + #include "sql/iterators/hash_join_iterator.h" +@@ -204,7 +204,7 @@ static void BM_XXHash64ShortData(size_t + + size_t sum = 0; + for (size_t i = 0; i < num_iterations; ++i) { +- sum += MY_XXH64(&data[0], data.size(), 0); ++ sum += XXH64(&data[0], data.size(), 0); + } + StopBenchmarkTiming(); + +@@ -223,7 +223,7 @@ static void BM_XXHash64LongData(size_t n + + size_t sum = 0; + for (size_t i = 0; i < num_iterations; ++i) { +- sum += MY_XXH64(&data[0], data.size(), 0); ++ sum += XXH64(&data[0], data.size(), 0); + } + StopBenchmarkTiming(); + +--- mysql-8.0.30/unittest/gunit/innodb/ut0rnd-t.cc.orig 2022-07-06 23:36:34.000000000 +0200 ++++ mysql-8.0.30/unittest/gunit/innodb/ut0rnd-t.cc 2022-10-09 20:46:00.157041753 +0200 +@@ -33,7 +33,7 @@ + #include "storage/innobase/include/ut0crc32.h" + #include "storage/innobase/include/ut0rnd.h" + +-#include "my_xxhash.h" ++#include + + namespace innodb_ut0rnd_unittest { + diff --git a/mysql-versioning.patch b/mysql-versioning.patch deleted file mode 100644 index 325bd46..0000000 --- a/mysql-versioning.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -urNp -x '*.orig' percona-server-5.7.37-40.org/libmysql/libmysql.map percona-server-5.7.37-40/libmysql/libmysql.map ---- percona-server-5.7.37-40.org/libmysql/libmysql.map 2022-04-04 12:10:54.703864495 +0200 -+++ percona-server-5.7.37-40/libmysql/libmysql.map 2022-04-04 12:11:12.985905674 +0200 -@@ -145,6 +145,7 @@ libmysqlclient_18 { - mysql_net_realloc; - # PHP's mysqli.so requires this (via the ER() macro) - mysql_client_errors; -+ client_errors; - # mydumper requires this (added by remi) - my_net_read; - }; -@@ -152,4 +153,6 @@ libmysqlclient_18 { - libmysqlclient_18_1 { - global: - get_tty_password; -+# for mysql-workbench 6.1 -+ mysql_options4; - }; diff --git a/mysql.init b/mysql.init index 9f0867e..c0a7a26 100755 --- a/mysql.init +++ b/mysql.init @@ -1,6 +1,6 @@ #!/bin/sh # -# mysql A very fast and reliable SQL database engine +# mysql{MYSQL_MAJOR} A very fast and reliable SQL database engine # # chkconfig: 2345 84 25 # @@ -13,30 +13,30 @@ . /etc/sysconfig/network # Get service config -if [ -f /etc/sysconfig/mysql ]; then - . /etc/sysconfig/mysql +if [ -f /etc/sysconfig/mysql{MYSQL_MAJOR} ]; then + . /etc/sysconfig/mysql{MYSQL_MAJOR} else - nls "Error: %s not found" /etc/sysconfig/mysql - nls "%s can't be run." MySQL + nls "Error: %s not found" /etc/sysconfig/mysql{MYSQL_MAJOR} + nls "%s can't be run." MySQL{MYSQL_MAJOR} exit 1 fi if [ -n "$MYSQL_DB_CLUSTERS" ]; then - nls "Warning: MYSQL_DB_CLUSTERS is set. It's obsolete. Use %s instead." /etc/mysql/clusters.conf + nls "Warning: MYSQL_DB_CLUSTERS is set. It's obsolete. Use %s instead." /etc/mysql{MYSQL_MAJOR}/clusters.conf fi -if [ -f /etc/mysql/clusters.conf ]; then - MYSQL_DB_CLUSTERS=$(awk -F= '!/^#/ && /=/{print $2}' /etc/mysql/clusters.conf) +if [ -f /etc/mysql{MYSQL_MAJOR}/clusters.conf ]; then + MYSQL_DB_CLUSTERS=$(awk -F= '!/^#/ && /=/{print $2}' /etc/mysql{MYSQL_MAJOR}/clusters.conf) if [ -z "$MYSQL_DB_CLUSTERS" ]; then nls "Warning: there are no configured clusters." fi else - nls "Warning: Missing clusters config file %s" /etc/mysql/clusters.conf + nls "Warning: Missing clusters config file %s" /etc/mysql{MYSQL_MAJOR}/clusters.conf if [ -z "$MYSQL_DB_CLUSTERS" ]; then nls "Warning: there are no configured clusters." - nls "Using default cluster /var/lib/mysql (compatibility mode)" - MYSQL_DB_CLUSTERS=/var/lib/mysql + nls "Using default cluster /var/lib/mysql{MYSQL_MAJOR} (compatibility mode)" + MYSQL_DB_CLUSTERS=/var/lib/mysql{MYSQL_MAJOR}/01 fi fi @@ -44,14 +44,14 @@ fi # Check that networking is up if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then - msg_network_down MySQL + msg_network_down MySQL{MYSQL_MAJOR} exit 1 fi else exit 0 fi -sharedir=/usr/share/mysql +sharedir=/usr/share/mysql{MYSQL_MAJOR} action="$1" @@ -60,9 +60,9 @@ if [ $# -gt 1 ]; then shift # perform action for specified clusters only for a in "$@"; do - # try auto resolving from /etc/mysql/clusters.conf + # try auto resolving from /etc/mysql{MYSQL_MAJOR}/clusters.conf if [[ "$a" != /* ]]; then - m=$(awk -va="$a" -F= 'substr($0, 1, length(a)) == a {print $1}' /etc/mysql/clusters.conf) + m=$(awk -va="$a" -F= 'substr($0, 1, length(a)) == a {print $1}' /etc/mysql{MYSQL_MAJOR}/clusters.conf) if [ -z "$m" ]; then echo >&2 "Cluster name '$a' did not match anything!" exit 1 @@ -71,7 +71,7 @@ if [ $# -gt 1 ]; then echo >&2 "Cluster name '$a' ambiguous:" $m exit 1 fi - a=$(awk -va="$a" -F= 'substr($0, 1, length(a)) == a {print $2}' /etc/mysql/clusters.conf) + a=$(awk -va="$a" -F= 'substr($0, 1, length(a)) == a {print $2}' /etc/mysql{MYSQL_MAJOR}/clusters.conf) fi DB_CLUSTERS="$DB_CLUSTERS $a" done @@ -80,7 +80,7 @@ else fi # global error log, if mysqld.conf hasn't migrated to log-error style -MYSQL_ERRLOG=/var/log/mysql/mysqld.log +MYSQL_ERRLOG=/var/log/mysql{MYSQL_MAJOR}/mysqld.log MYSQL_STOP_WAIT_TIME=${MYSQL_STOP_WAIT_TIME:-900} # @@ -125,7 +125,7 @@ mysqlstatus() { fi if [ "$mode" = "start" ]; then - MYSQL_GREP_PID=$(grep -alE "^/usr/sbin/mysqld.*${MYSQL_PIDFILE}" /proc/[0-9]*/cmdline 2> /dev/null | awk -F "/" '{ print $3; exit; }') + MYSQL_GREP_PID=$(grep -alE "^/usr/sbin/mysqld{MYSQL_MAJOR}.*${MYSQL_PIDFILE}" /proc/[0-9]*/cmdline 2> /dev/null | awk -F "/" '{ print $3; exit; }') if [ -n "$MYSQL_GREP_PID" ]; then MYSQL_PID=$MYSQL_GREP_PID if grep -qa "$MYSQL_PIDFILE" /proc/$MYSQL_PID/cmdline 2> /dev/null; then @@ -159,20 +159,14 @@ mysqlgetconfig() { local clusterdir="$1" config_file local mode="$2" - # emulate old behaviour if only one cluster specified - if [ "$clusterdir" = "$MYSQL_DB_CLUSTERS" -a "$clusterdir" = "/var/lib/mysql" -a -f /etc/mysqld.conf ]; then - MYSQL_RA_COMPAT=yes - config_file=/etc/mysqld.conf - else - local config=$(awk -F= -vclusterdir="$clusterdir" '!/^#/{ if (clusterdir == $2) print $1}' /etc/mysql/clusters.conf) - if [[ $config = /* ]]; then - config_file="$config" - elif [ -f "/etc/mysql/$config" ]; then - config_file="/etc/mysql/$config" - else - config_file="$clusterdir/mysqld.conf" - fi - fi + local config=$(awk -F= -vclusterdir="$clusterdir" '!/^#/{ if (clusterdir == $2) print $1}' /etc/mysql{MYSQL_MAJOR}/clusters.conf) + if [[ $config = /* ]]; then + config_file="$config" + elif [ -f "/etc/mysql{MYSQL_MAJOR}/$config" ]; then + config_file="/etc/mysql{MYSQL_MAJOR}/$config" + else + config_file="$clusterdir/mysqld.conf" + fi MYSQL_CLUSTER_DIR="$clusterdir" @@ -189,7 +183,7 @@ mysqlgetconfig() { if [ ! -f "$config_file" ]; then nls "Error: config file %s not found" "$config_file" - nls "MySQL can't be run. Did you initialize DB by doing \`$0 init'?" + nls "MySQL{MYSQL_MAJOR} can't be run. Did you initialize DB by doing \`$0 init'?" if [ "$mode" = "status" ]; then exit 3 else @@ -248,11 +242,7 @@ mysqlgetconfig() { unset MYSQL_LOG_ERROR fi - if is_yes "$MYSQL_RA_COMPAT"; then - MYSQL_DATA_DIR_SUB="" - else - MYSQL_DATA_DIR_SUB="/mysqldb" - fi + MYSQL_DATA_DIR_SUB="/mysqldb" if [ -z "$MYSQL_DATA_DIR" -o "$MYSQL_DATA_DIR" != "${clusterdir}${MYSQL_DATA_DIR_SUB}/db" ]; then nls "Error: datadir specified in %s should be %s" "$config_file" "$clusterdir${MYSQL_DATA_DIR_SUB}/db" @@ -267,7 +257,7 @@ mysqlgetconfig() { fi if [ -z "$MYSQL_USER" ]; then - echo "$(nls 'MySQL user not configured properly')"'!' >&2 + echo "$(nls 'MySQL{MYSQL_MAJOR} user not configured properly')"'!' >&2 nls "Edit %s and configure it." "$config_file" >&2 exit 6 fi @@ -278,23 +268,23 @@ mysqlstart() { local clusterdir="$1" mysqlgetconfig "$clusterdir" if [ ! -d "$MYSQL_DATA_DIR/mysql" ]; then - nls "MySQL cluster %s not initialized." "$clusterdir" + nls "MySQL{MYSQL_MAJOR} cluster %s not initialized." "$clusterdir" nls "Try \`%s init %s' before start." "$0" "$clusterdir" exit 6 fi - msg_starting "MySQL $clusterdir"; busy + msg_starting "MySQL{MYSQL_MAJOR} $clusterdir"; busy [ -z "$DEFAULT_SERVICE_RUN_NICE_LEVEL" ] && DEFAULT_SERVICE_RUN_NICE_LEVEL=0 rm -f "$MYSQL_PIDFILE" TMPDIR=/tmp nice -n ${SERVICE_RUN_NICE_LEVEL:-$DEFAULT_SERVICE_RUN_NICE_LEVEL} \ - /usr/bin/setsid /usr/sbin/mysqld \ + /usr/bin/setsid /usr/sbin/mysqld{MYSQL_MAJOR} \ --defaults-file=$MYSQL_CONFIG \ --datadir=$MYSQL_DATA_DIR \ --pid-file=$MYSQL_PIDFILE \ ${MYSQL_LOG_ERROR:+--log-error="$MYSQL_LOG_ERROR"} \ - $MYSQL_OPTIONS 2>/dev/null & + $MYSQL_OPTIONS & pid=$! sleep 0.1 @@ -302,7 +292,7 @@ mysqlstart() { # it takes longer for mysqld to start and create pidfile if it has to recover innodb transactions if [ "$MYSQL_STATUS" = "starting" ]; then echo "" - show "Waiting for MySQL to start" + show "Waiting for MySQL{MYSQL_MAJOR} to start" busy # while the pid is running, mysql is starting up @@ -336,7 +326,7 @@ mysqlstop() { # try graceful shutdown -- send shutdown command # requires mysql_sysadmin user proper privs - /usr/bin/mysqladmin --defaults-file=$MYSQL_CONFIG ${MYSQL_SOCKET:+--socket=$MYSQL_SOCKET} shutdown >/dev/null 2>&1 + /usr/bin/mysqladmin{MYSQL_MAJOR} --defaults-file=$MYSQL_CONFIG ${MYSQL_SOCKET:+--socket=$MYSQL_SOCKET} shutdown >/dev/null 2>&1 mysqlstatus "$clusterdir" stop if [ "$MYSQL_PID" != "unknown" ]; then @@ -360,13 +350,13 @@ mysqlstop() { # report slave status # uses MYSQL_SOCKET - path to mysql socket slave_status() { - if [ ! -x /usr/bin/mysql ]; then - echo >&2 "Slave status not available: 'mysql' program not installed." + if [ ! -x /usr/bin/mysql{MYSQL_MAJOR} ]; then + echo >&2 "Slave status not available: 'mysql{MYSQL_MAJOR}' program not installed." return fi # see if slave status can be reported - local err=0 slave_status=$(mysql --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" -e 'show slave status\G') + local err=0 slave_status=$(mysql{MYSQL_MAJOR} --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" -e 'show slave status\G') if [ -z "$slave_status" ]; then # slave not setup return @@ -426,26 +416,20 @@ mysqlsubsys() { for mysqldir in $DB_CLUSTERS; do mysqlstatus "$mysqldir" if [ "$MYSQL_STATUS" = "running" ]; then - touch /var/lock/subsys/mysql + touch /var/lock/subsys/mysql{MYSQL_MAJOR} return fi done - rm -f /var/lock/subsys/mysql + rm -f /var/lock/subsys/mysql{MYSQL_MAJOR} } mysqlinit() { local clusterdir="$1" - if [ -f /etc/mysqld.conf ]; then - nls "Running in \`no cluster compat' mode: can't initialize database." - nls "Move /etc/mysqld.conf away and rerun \`$0 init' (new config will be in $clusterdir)." - exit 1 - fi - if [ -f "$clusterdir/mysqld.conf" ]; then mysqlgetconfig "$clusterdir" else - MYSQL_USER="mysql" + MYSQL_USER="root" MYSQL_CLUSTER_DIR="$clusterdir" MYSQL_DATA_DIR="$clusterdir/mysqldb/db" MYSQL_PIDFILE="$clusterdir/mysqldb/mysql.pid" @@ -455,7 +439,7 @@ mysqlinit() { MYSQL_CONFIG="$MYSQL_CLUSTER_DIR/mysqld.conf" fi - show "Initializing MySQL cluster %s" "$clusterdir"; started + show "Initializing cluster %s" "$clusterdir"; started # Check if not exist init database if [ -d "$MYSQL_DATA_DIR/mysql" ]; then @@ -465,7 +449,7 @@ mysqlinit() { exit 6 fi - show "Installing MySQL system tables for $MYSQL_DATA_DIR" + show "Initializing MySQL{MYSQL_MAJOR} database for $MYSQL_DATA_DIR" busy TMP=/tmp TMPDIR=/tmp @@ -487,33 +471,49 @@ mysqlinit() { fi ok=0 - /usr/sbin/mysqld \ + /usr/sbin/mysqld{MYSQL_MAJOR} \ --defaults-file=$MYSQL_CLUSTER_DIR/mysqld.conf \ - --initialize-insecure \ + --initialize \ --skip-grant-tables \ --datadir=$MYSQL_DATA_DIR \ --user=$MYSQL_USER \ - --slave-load-tmpdir=$MYSQL_DATA_DIR \ --tmpdir=$MYSQL_DATA_DIR \ - --log-error=$MYSQL_ERRLOG && ok=1 - [ -f $MYSQL_DATA_DIR/mysql/user.frm ] || ok=0 + --log-error=$MYSQL_ERRLOG \ + && ok=1 + [ -f $MYSQL_DATA_DIR/mysql.ibd ] || ok=0 if [ "$ok" = 1 ]; then ok cat << END_OF_MSG -PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL USERS! -This is done, after starting database, in the order shown below, -with: +PLEASE REMEMBER TO CHANGE A PASSWORD FOR THE MySQL{MYSQL_MAJOR} USERS! + +Start database: +$ service mysql{MYSQL_MAJOR} start + +and set passwords: + +For 'root' user (ALL privileges, DB admin), paste command with new password: +ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; +FLUSH PRIVILEGES; + +For 'mysql_sysadmin' (RELOAD, SHUTDOWN and REPLICATION CLIENT privileges): +CREATE USER 'mysql_sysadmin'@'localhost' IDENTIFIED BY 'sysnewpassword' PASSWORD EXPIRE NEVER; +GRANT RELOAD, SHUTDOWN, REPLICATION CLIENT ON *.* TO 'mysql_sysadmin'@'localhost'; +FLUSH PRIVILEGES; + + +Both into command: +$ mysql{MYSQL_MAJOR} -u root -p --ssl-mode=disabled -S $MYSQL_SOCKET -Add 'mysql_sysadmin' user (RELOAD and SHUTDOWN privileges): -echo "CREATE USER 'mysql_sysadmin'@'localhost' IDENTIFIED BY 'SOME_RANDOM_PASSWORD'; FLUSH PRIVILEGES;" | mysql --ssl-mode=DISABLED -u root -S $MYSQL_SOCKET -echo "GRANT RELOAD, SHUTDOWN ON *.* TO 'mysql_sysadmin'@'localhost'; FLUSH PRIVILEGES;" | mysql --ssl-mode=DISABLED -u root -S $MYSQL_SOCKET +NOTE 1: +CURRENT TEMPORARY ROOT PASSWORD CAN BE FOUND IN LOG +(grep for "A temporary password is generated" string): +$MYSQL_ERRLOG -Set password for root user (ALL privileges, DB admin): -echo "ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; FLUSH PRIVILEGES;" | mysql --ssl-mode=DISABLED -u root -S $MYSQL_SOCKET -NOTE: mysql_sysadmin password should be placed to $MYSQL_CONFIG in +NOTE 2: +mysql_sysadmin password should be placed to $MYSQL_CONFIG in mysqladmin section. See the manual for more instructions. (This user is used at logs rotation and server shutdown) @@ -523,27 +523,27 @@ END_OF_MSG cat << END_OF_MSG ERROR: ERROR: -ERROR: Initialization of server FAILED! +ERROR: Installation FAILED! ERROR: ERROR: -Examine the logs in /var/log/mysql for more information. You can +Examine the logs in $MYSQL_ERRLOG for more information. You can also try to start the mysqld daemon with: -/usr/sbin/mysqld --skip-grant & +/usr/sbin/mysqld{MYSQL_MAJOR} --skip-grant & You can use the command line tool mysql to connect to the mysql database and look at the grant tables: -shell> mysql -u root mysql +shell> mysql{MYSQL_MAJOR} -u mysql mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Setting on -logging in $MYSQL_DATA_DIR/mysqld.conf gives you a log in /var/log/mysql/query.log that +logging in $MYSQL_DATA_DIR/mysqld.conf gives you a log in /var/log/mysql{MYSQL_MAJOR}/query.log that may be helpful. The latest information about MySQL is available on the -web at https://www.percona.com/software/mysql-database/mysql. +web at http://www.mysql.com/. -Please check TLD Linux ftp site for newer versions of this package. +Please check PLD Linux ftp site for newer versions of this package. Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on @@ -554,13 +554,13 @@ END_OF_MSG fi # if it's first server, register as default - if [ ! -e /var/lib/mysql/mysql.sock ] || [ -L /var/lib/mysql/mysql.sock ] && [ -z "$(readlink /var/lib/mysql/mysql.sock)" ]; then - sock=${MYSQL_SOCKET#/var/lib/mysql/} # make it relative if possible - ln -s "$sock" /var/lib/mysql/mysql.sock + if [ ! -e /var/lib/mysql{MYSQL_MAJOR}/mysql.sock ] || [ -L /var/lib/mysql{MYSQL_MAJOR}/mysql.sock ] && [ -z "$(readlink /var/lib/mysql{MYSQL_MAJOR}/mysql.sock)" ]; then + sock=${MYSQL_SOCKET#/var/lib/mysql{MYSQL_MAJOR}/} # make it relative if possible + ln -s "$sock" /var/lib/mysql{MYSQL_MAJOR}/mysql.sock fi # same for config, move to /etc - if [ ! -e /etc/mysql/mysqld.conf ]; then - mv "$MYSQL_CLUSTER_DIR/mysqld.conf" /etc/mysql/mysqld.conf + if [ ! -e /etc/mysql{MYSQL_MAJOR}/mysqld.conf ]; then + mv "$MYSQL_CLUSTER_DIR/mysqld.conf" /etc/mysql{MYSQL_MAJOR}/mysqld.conf fi } @@ -595,8 +595,8 @@ stop() { } condrestart() { - if [ ! -f /var/lock/subsys/mysql ]; then - msg_not_running "MySQL" + if [ ! -f /var/lock/subsys/mysql{MYSQL_MAJOR} ]; then + msg_not_running "MySQL{MYSQL_MAJOR}" RETVAL=$1 return fi @@ -614,7 +614,7 @@ status() { RETVAL=0 addr=${MYSQL_BIND_ADDRESS:-0.0.0.0} port=${MYSQL_PORT:-3306} - socket=${MYSQL_SOCKET:-/var/lib/mysql/mysql.sock} + socket=${MYSQL_SOCKET:-/var/lib/mysql{MYSQL_MAJOR}/mysql.sock} pid=$MYSQL_PID nls "MySQL cluster %s, pid %s\n" "$mysqldir" "$pid" [ -z "$MYSQL_SKIP_NETWORKING" ] && nls "\ttcp:%s:%s\n" "$addr" "$port" @@ -631,7 +631,7 @@ status() { echo done - for pid in $(/sbin/pidof mysqld); do + for pid in $(/sbin/pidof mysqld{MYSQL_MAJOR}); do if [[ $pids != */$pid/* ]]; then running="$running $pid" fi @@ -648,7 +648,7 @@ status() { if [ "$MYSQL_STATUS" = "running" ]; then addr=${MYSQL_BIND_ADDRESS:-0.0.0.0} port=${MYSQL_PORT:-3306} - socket=${MYSQL_SOCKET:-/var/lib/mysql/mysql.sock} + socket=${MYSQL_SOCKET:-/var/lib/mysql{MYSQL_MAJOR}/mysql.sock} nls "MySQL cluster %s, pid %s\n" "$mysqldir" "$pid" [ -z "$MYSQL_SKIP_NETWORKING" ] && nls "\ttcp:%s:%s\n" "$addr" "$port" nls "\tunix: %s\n" "$socket" @@ -693,8 +693,8 @@ case "$action" in for mysqldir in $DB_CLUSTERS; do mysqlgetconfig "$mysqldir" # just if mysqld is really running - if /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then - /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs + if /usr/bin/mysqladmin{MYSQL_MAJOR} --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then + /usr/bin/mysqladmin{MYSQL_MAJOR} --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs fi done ;; diff --git a/mysql.logrotate b/mysql.logrotate index 4bb78ce..26a4e69 100644 --- a/mysql.logrotate +++ b/mysql.logrotate @@ -11,12 +11,12 @@ # # You must do this for every active cluster defined in /etc/mysql/clusters.conf -/var/log/mysql/query.log -/var/log/mysql/mysqld.log -/var/log/mysql/slow.log -/var/log/mysql/update* +/var/log/mysql{MYSQL_MAJOR}/query.log +/var/log/mysql{MYSQL_MAJOR}/mysqld.log +/var/log/mysql{MYSQL_MAJOR}/slow.log +/var/log/mysql{MYSQL_MAJOR}/update* { - olddir /var/log/archive/mysql + olddir /var/log/archive/mysql{MYSQL_MAJOR} notifempty missingok create 640 mysql mysql @@ -29,6 +29,6 @@ daily postrotate - /sbin/service mysql flush-logs + /sbin/service mysql{MYSQL_MAJOR} flush-logs endscript } diff --git a/mysql.spec b/mysql.spec index f1b667e..b01f597 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,4 +1,6 @@ # TODO: +# - -DWITH_AUTHENTICATION_KERBEROS=ON (BR: MIT krb5) +# - -DWITH_AUTHENTICATION_FIDO=ON (using system libfido?) # - mysqldump ... (invalid usage) prints to stdout not stderr (idiotic if you want to create dump and get usage in .sql) # - http://bugs.mysql.com/bug.php?id=16470 # - innodb are dynamic (= as plugins) ? @@ -9,43 +11,22 @@ # - segfaults on select from non-mysql user (caused by builder environment): # https://bugs.launchpad.net/pld-linux/+bug/381904 # (profiling disabled temporaily to workaround this) -# - unpackaged files: -# /usr/COPYING.AGPLv3 -# /usr/COPYING.GPLv2 -# /usr/PATENTS -# /usr/README.md -# /usr/bin/mysqlxtest -# /usr/include/backup.h -# NOTE: -# - mysql 'root' user will be 'root' not 'mysql' with 5.7 package -# this is to make pld consistent what the rest of the world uses. # # Conditional build: -%bcond_with autodeps # BR packages needed only for resolving deps %bcond_without innodb # InnoDB storage engine support %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms %bcond_without federated # Federated storage engine support %bcond_without raid # RAID support %bcond_without ssl # OpenSSL support -%bcond_with systemtap # systemtap/dtrace probes +%bcond_without systemtap # systemtap/dtrace probes %bcond_without tcpd # libwrap (tcp_wrappers) support %bcond_with sphinx # Sphinx storage engine support -%bcond_with tokudb # TokuDB -%bcond_with rocksdb # RocksDB -# mysql needs boost 1.59.0 and doesn't support newer/older boost versions -%bcond_with system_boost # Use system boost package -%bcond_with tests # FIXME: don't run correctly +# mysql needs boost 1.77.0 and doesn't support newer/older boost versions +%bcond_with system_boost +%bcond_without tests # run test suite %bcond_with ndb # NDB is now a separate product, this here is broken, so disable it -%bcond_with coredumper # coredumper support +%bcond_without ldap # LDAP auth support (requires MIT Kerberos) -# tokudb is only supported on x86_64 -%ifnarch %{x8664} -%undefine with_rocksdb -%undefine with_tokudb -%endif - -%define rel 1 -%define percona_rel 46 Summary: MySQL: a very fast and reliable SQL database engine Summary(de.UTF-8): MySQL: ist eine SQL-Datenbank Summary(fr.UTF-8): MySQL: un serveur SQL rapide et fiable @@ -54,66 +35,77 @@ Summary(pt_BR.UTF-8): MySQL: Um servidor SQL rápido e confiável Summary(ru.UTF-8): MySQL - быстрый SQL-сервер Summary(uk.UTF-8): MySQL - швидкий SQL-сервер Summary(zh_CN.UTF-8): MySQL数据库服务器 -Name: mysql -Version: 5.7.42 -Release: %{percona_rel}.%{rel} -License: GPL + MySQL FLOSS Exception +%define majorver 8.2 +Name: mysql%{majorver} +Version: 8.2.0 +Release: 0.1 +License: GPL v2 + MySQL FOSS License Exception Group: Applications/Databases -Source0: https://www.percona.com/downloads/Percona-Server-5.7/LATEST/source/tarball/percona-server-%{version}-%{percona_rel}.tar.gz -# Source0-md5: 6f937a7fe774edad0213a75e34df19d5 +#Source0Download: https://dev.mysql.com/downloads/mysql/8.2.html#downloads +Source0: http://cdn.mysql.com/Downloads/MySQL-%{majorver}/mysql-%{version}.tar.gz +# Source0-md5: 9ddeecbdb046cd4a8a4340445206130d Source100: http://www.sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz # Source100-md5: 5cac34f3d78a9d612ca4301abfcbd666 %if %{without system_boost} -Source101: http://downloads.sourceforge.net/boost/boost_1_59_0.tar.bz2 -# Source101-md5: 6aa9a5c6a4ca1016edd0ed1178e3cb87 +Source101: http://downloads.sourceforge.net/boost/boost_1_77_0.tar.bz2 +# Source101-md5: 09dc857466718f27237144c6f2432d86 %endif -Source1: %{name}.init -Source2: %{name}.sysconfig -Source3: %{name}.logrotate +Source1: mysql.init +Source2: mysql.sysconfig +Source3: mysql.logrotate Source4: mysqld.conf -Source5: %{name}-clusters.conf -Source7: %{name}-ndb.init -Source8: %{name}-ndb.sysconfig -Source9: %{name}-ndb-mgm.init -Source10: %{name}-ndb-mgm.sysconfig -Source11: %{name}-ndb-cpc.init -Source12: %{name}-ndb-cpc.sysconfig -Source13: %{name}-client.conf +Source5: mysql-clusters.conf +Source7: mysql-ndb.init +Source8: mysql-ndb.sysconfig +Source9: mysql-ndb-mgm.init +Source10: mysql-ndb-mgm.sysconfig +Source11: mysql-ndb-cpc.init +Source12: mysql-ndb-cpc.sysconfig +Source13: mysql-client.conf Source14: my.cnf Patch0: mysql-opt.patch -Patch1: mysql-versioning.patch -Patch2: mysql-protobuf.patch -Patch3: build.patch -Patch4: mysql-sphinx.patch -Patch5: mysql-5.7-sphinx.patch -Patch6: mysql-chain-certs.patch -Patch7: mysql-dubious-exports.patch -Patch8: mysql-cmake.patch -URL: https://www.percona.com/software/mysql-database/percona-server +Patch1: mysql-system-xxhash.patch + +Patch17: mysql-5.7-sphinx.patch +Patch18: mysql-sphinx.patch + +Patch24: mysql-cmake.patch +Patch25: mysql-readline.patch + +Patch26: mysqldumpslow-clusters.patch +URL: http://www.mysql.com/products/community/ BuildRequires: bison >= 1.875 +%{?with_system_boost:BuildRequires: boost-devel >= 1.77.0} BuildRequires: cmake >= 2.8.2 -BuildRequires: curl-devel -BuildRequires: readline-devel >= 6.2 -BuildRequires: libstdc++-devel >= 5:4.0 -BuildRequires: automake -%{?with_system_boost:BuildRequires: boost-devel = 1.59.0} +%{?with_ldap:BuildRequires: cyrus-sasl-devel} +# for configure and tests +%{?with_ldap:BuildRequires: cyrus-sasl-scram} +#%{?with_ldap:BuildRequires: krb5-devel} +BuildRequires: libaio-devel +BuildRequires: libevent-devel BuildRequires: libhsclient-devel +BuildRequires: libstdc++-devel >= 5:7.1 %{?with_tcpd:BuildRequires: libwrap-devel} -BuildRequires: lz4-devel >= 1:1.9.3 +BuildRequires: lz4-devel BuildRequires: mecab-devel BuildRequires: ncurses-devel >= 4.2 -%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d} +%{?with_ssl:BuildRequires: openssl-devel >= 1.1.1} +%{?with_ldap:BuildRequires: openldap-devel} BuildRequires: pam-devel -%{?with_autodeps:BuildRequires: perl-DBI} BuildRequires: perl-devel >= 1:5.6.1 -BuildRequires: protobuf-devel -BuildRequires: python3-modules +BuildRequires: protobuf-devel >= 2.5 +BuildRequires: python-modules +BuildRequires: readline-devel >= 6.2 BuildRequires: rpcsvc-proto +BuildRequires: rpm-build >= 4.6 BuildRequires: rpm-perlprov >= 4.1-13 -BuildRequires: rpmbuild(macros) >= 1.597 +BuildRequires: rpmbuild(macros) >= 1.605 BuildRequires: sed >= 4.0 %{?with_systemtap:BuildRequires: systemtap-sdt-devel} -BuildRequires: zlib-devel +BuildRequires: xxHash-devel +BuildRequires: zlib-devel >= 1.2.12 +BuildRequires: zstd-devel +Requires(post): sed >= 4.0 Requires(post,preun): /sbin/chkconfig Requires(postun): /usr/sbin/groupdel Requires(postun): /usr/sbin/userdel @@ -121,137 +113,134 @@ Requires(pre): /bin/id Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd -Requires(post): sed >= 4.0 Requires: %{name}-charsets = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: /usr/bin/setsid Requires: rc-scripts >= 0.2.0 -Suggests: mysql-client +Suggests: %{name}-client %{?with_tcpd:Suggests: tcp_wrappers} Suggests: vim-syntax-mycnf Provides: MySQL-server Provides: group(mysql) Provides: msqlormysql Provides: user(mysql) -Obsoletes: MySQL -Obsoletes: mysql-server +Obsoletes: MySQL < 3.22.27 +Obsoletes: mysql-server < 4 Conflicts: logrotate < 3.8.0 -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +# "MySQL supports only 64-bit platforms." +BuildArch: %{x8664} %{arch64} +BuildRoot: %{tmpdir}/mysql-%{version}-root-%(id -u -n) %define _libexecdir %{_sbindir} -%define _localstatedir /var/lib/mysql +%define _localstatedir /var/lib/%{name} %define _mysqlhome /home/services/%{name} %description -MySQL is a true multi-user, multi-threaded SQL (Structured -Query Language) database server. SQL is the most popular database -language in the world. MySQL is a client/server -implementation that consists of a server daemon mysqld and many -different client programs/libraries. - -The main goals of MySQL are speed, robustness and easy to -use. MySQL was originally developed because we at Tcx needed -a SQL server that could handle very big databases with magnitude -higher speed than what any database vendor could offer to us. We have -now been using MySQL since 1996 in a environment with more -than 40 databases, 10,000 tables, of which more than 500 have more -than 7 million rows. This is about 50G of mission critical data. - -The base upon which MySQL is built is a set of routines that -have been used in a highly demanding production environment for many -years. While MySQL is still in development, it already offers -a rich and highly useful function set. +MySQL is a true multi-user, multi-threaded SQL (Structured Query +Language) database server. SQL is the most popular database language +in the world. MySQL is a client/server implementation that consists of +a server daemon mysqld and many different client programs/libraries. + +The main goals of MySQL are speed, robustness and easy to use. MySQL +was originally developed because we at Tcx needed a SQL server that +could handle very big databases with magnitude higher speed than what +any database vendor could offer to us. We have now been using MySQL +since 1996 in a environment with more than 40 databases, 10,000 +tables, of which more than 500 have more than 7 million rows. This is +about 50G of mission critical data. + +The base upon which MySQL is built is a set of routines that have been +used in a highly demanding production environment for many years. +While MySQL is still in development, it already offers a rich and +highly useful function set. %description -l fr.UTF-8 -MySQL est un serveur de bases de donnees SQL vraiment -multi-usagers et multi-taches. Le langage SQL est le langage de bases -de donnees le plus populaire au monde. MySQL est une -implementation client/serveur qui consiste en un serveur (mysqld) et -differents programmes/bibliotheques clientes. - -Les objectifs principaux de MySQL sont: vitesse, robustesse -et facilite d'utilisation. MySQL fut originalement developpe -parce que nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait -gerer de tres grandes bases de donnees avec une vitesse d'un ordre de -magnitude superieur a ce que n'importe quel vendeur pouvait nous -offrir. Nous utilisons MySQL depuis 1996 dans un -environnement avec plus de 40 bases de donnees, 10000 tables, -desquelles plus de 500 ont plus de 7 millions de lignes. Ceci -represente environ 50G de donnees critiques. - -A la base de la conception de MySQL, on retrouve une serie de -routines qui ont ete utilisees dans un environnement de production -pendant plusieurs annees. Meme si MySQL est encore en -developpement, il offre deja une riche et utile serie de fonctions. +MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et +multi-taches. Le langage SQL est le langage de bases de donnees le +plus populaire au monde. MySQL est une implementation client/serveur +qui consiste en un serveur (mysqld) et differents +programmes/bibliotheques clientes. + +Les objectifs principaux de MySQL sont: vitesse, robustesse et +facilite d'utilisation. MySQL fut originalement developpe parce que +nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de +tres grandes bases de donnees avec une vitesse d'un ordre de magnitude +superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous +utilisons MySQL depuis 1996 dans un environnement avec plus de 40 +bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7 +millions de lignes. Ceci represente environ 50G de donnees critiques. + +A la base de la conception de MySQL, on retrouve une serie de routines +qui ont ete utilisees dans un environnement de production pendant +plusieurs annees. Meme si MySQL est encore en developpement, il offre +deja une riche et utile serie de fonctions. %description -l pl.UTF-8 -MySQL to prawdziwie wieloużytkownikowy, wielowątkowy serwer -baz danych SQL. SQL jest najpopularniejszym na świecie językiem -używanym do baz danych. MySQL to implementacja klient/serwer -składająca się z demona mysqld i wielu różnych programów i bibliotek -klienckich. - -Głównymi celami MySQL-a są szybkość, potęga i łatwość -użytkowania. MySQL oryginalnie był tworzony, ponieważ autorzy -w Tcx potrzebowali serwera SQL do obsługi bardzo dużych baz danych z -szybkością o wiele większą, niż mogli zaoferować inni producenci baz -danych. Używają go od 1996 roku w środowisku z ponad 40 bazami danych, -10 000 tabel, z których ponad 500 zawiera ponad 7 milionów rekordów - -w sumie około 50GB krytycznych danych. - -Baza, na której oparty jest MySQL, składa się ze zbioru -procedur, które były używane w bardzo wymagającym środowisku -produkcyjnym przez wiele lat. Pomimo, że MySQL jest ciągle -rozwijany, już oferuje bogaty i użyteczny zbiór funkcji. +MySQL to prawdziwie wieloużytkownikowy, wielowątkowy serwer baz danych +SQL. SQL jest najpopularniejszym na świecie językiem używanym do baz +danych. MySQL to implementacja klient/serwer składająca się z demona +mysqld i wielu różnych programów i bibliotek klienckich. + +Głównymi celami MySQL-a są szybkość, potęga i łatwość użytkowania. +MySQL oryginalnie był tworzony, ponieważ autorzy w Tcx potrzebowali +serwera SQL do obsługi bardzo dużych baz danych z szybkością o wiele +większą, niż mogli zaoferować inni producenci baz danych. Używają go +od 1996 roku w środowisku z ponad 40 bazami danych, 10 000 tabel, z +których ponad 500 zawiera ponad 7 milionów rekordów - w sumie około +50GB krytycznych danych. + +Baza, na której oparty jest MySQL, składa się ze zbioru procedur, +które były używane w bardzo wymagającym środowisku produkcyjnym przez +wiele lat. Pomimo, że MySQL jest ciągle rozwijany, już oferuje bogaty +i użyteczny zbiór funkcji. %description -l de.UTF-8 -MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz -zu Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten +MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu +Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten werden zwar in zweidimensionalen Tabellen gespeichert und können mit einem Primärschlüssel versehen werden. Es ist aber keine Definition eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer -MySQL-Datenbank völlig allein für die (referenzielle) -Integrität der Daten verantwortlich. Allein durch die Nutzung externer +MySQL-Datenbank völlig allein für die (referenzielle) Integrität der +Daten verantwortlich. Allein durch die Nutzung externer Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität -ermöglicht. Diese Projekte sind aber getrennt von MySQL zu -betrachten. +ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten. %description -l pt_BR.UTF-8 -O MySQL é um servidor de banco de dados SQL realmente -multiusuário e multi-tarefa. A linguagem SQL é a mais popular -linguagem para banco de dados no mundo. O MySQL é uma -implementação cliente/servidor que consiste de um servidor chamado -mysqld e diversos programas/bibliotecas clientes. Os principais -objetivos do MySQL são: velocidade, robustez e facilidade de -uso. O MySQL foi originalmente desenvolvido porque nós na Tcx -precisávamos de um servidor SQL que pudesse lidar com grandes bases de -dados e com uma velocidade muito maior do que a que qualquer vendedor -podia nos oferecer. Estamos usando o MySQL desde 1996 em um -ambiente com mais de 40 bases de dados com 10.000 tabelas, das quais -mais de 500 têm mais de 7 milhões de linhas. Isto é o equivalente a -aproximadamente 50G de dados críticos. A base da construção do Percona -Server é uma série de rotinas que foram usadas em um ambiente de -produção com alta demanda por muitos anos. Mesmo o MySQL -estando ainda em desenvolvimento, ele já oferece um conjunto de +O MySQL é um servidor de banco de dados SQL realmente multiusuário e +multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de +dados no mundo. O MySQL é uma implementação cliente/servidor que +consiste de um servidor chamado mysqld e diversos +programas/bibliotecas clientes. Os principais objetivos do MySQL são: +velocidade, robustez e facilidade de uso. O MySQL foi originalmente +desenvolvido porque nós na Tcx precisávamos de um servidor SQL que +pudesse lidar com grandes bases de dados e com uma velocidade muito +maior do que a que qualquer vendedor podia nos oferecer. Estamos +usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados +com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de +linhas. Isto é o equivalente a aproximadamente 50G de dados críticos. +A base da construção do MySQL é uma série de rotinas que foram usadas +em um ambiente de produção com alta demanda por muitos anos. Mesmo o +MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de funções muito ricas e úteis. Veja a documentação para maiores informações. %description -l ru.UTF-8 -MySQL - это SQL (Structured Query Language) сервер базы -данных. MySQL была написана Michael'ом (monty) Widenius'ом. -См. файл CREDITS в дистрибутиве на предмет других участников проекта и -прочей информации о MySQL. +MySQL - это SQL (Structured Query Language) сервер базы данных. MySQL +была написана Michael'ом (monty) Widenius'ом. См. файл CREDITS в +дистрибутиве на предмет других участников проекта и прочей информации +о MySQL. %description -l uk.UTF-8 -MySQL - це SQL (Structured Query Language) сервер бази даних. -MySQL було написано Michael'ом (monty) Widenius'ом. Див. файл -CREDITS в дистрибутиві для інформації про інших учасників проекту та -іншої інформації. +MySQL - це SQL (Structured Query Language) сервер бази даних. MySQL +було написано Michael'ом (monty) Widenius'ом. Див. файл CREDITS в +дистрибутиві для інформації про інших учасників проекту та іншої +інформації. %package charsets Summary: MySQL - character sets definitions Summary(pl.UTF-8): MySQL - definicje kodowań znaków Group: Applications/Databases +BuildArch: noarch %description charsets This package contains character sets definitions needed by both client @@ -269,12 +258,12 @@ Requires: %{name}-client = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} %description extras -MySQL additional utilities except Perl scripts (they may be -found in %{name}-extras-perl package). +MySQL additional utilities except Perl scripts (they may be found in +%{name}-extras-perl package). %description extras -l pl.UTF-8 -Dodatkowe narzędzia do MySQL - z wyjątkiem skryptów Perla -(które są w pakiecie %{name}-extras-perl). +Dodatkowe narzędzia do MySQL - z wyjątkiem skryptów Perla (które są w +pakiecie %{name}-extras-perl). %package extras-perl Summary: MySQL additional utilities written in Perl @@ -299,7 +288,7 @@ Group: Applications/Databases Requires: %{name}-charsets = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: readline >= 6.2 -Obsoletes: MySQL-client +Obsoletes: MySQL-client < 3.22.27 %description client This package contains the standard MySQL clients. @@ -323,7 +312,8 @@ Este pacote contém os clientes padrão para o MySQL. Summary: Shared libraries for MySQL Summary(pl.UTF-8): Biblioteki współdzielone MySQL Group: Libraries -Obsoletes: libmysql10 +Requires: zlib >= 1.2.12 +Obsoletes: libmysql10 < 4 Obsoletes: mysql-doc < 4.1.12 %description libs @@ -340,10 +330,10 @@ Summary(ru.UTF-8): MySQL - хедеры и библиотеки разработ Summary(uk.UTF-8): MySQL - хедери та бібліотеки програміста Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} -%{?with_ssl:Requires: openssl-devel} -Requires: zlib-devel -Obsoletes: MySQL-devel -Obsoletes: libmysql10-devel +%{?with_ssl:Requires: openssl-devel >= 1.1.1} +Requires: zlib-devel >= 1.2.12 +Obsoletes: MySQL-devel < 3.22.27 +Obsoletes: libmysql10-devel < 4 Obsoletes: webscalesql-devel %description devel @@ -361,8 +351,7 @@ klienckich MySQL. %description devel -l pt_BR.UTF-8 Este pacote contém os arquivos de cabeçalho (header files) e -bibliotecas necessárias para desenvolver aplicações clientes do -MySQL. +bibliotecas necessárias para desenvolver aplicações clientes do MySQL. %description devel -l ru.UTF-8 Этот пакет содержит хедеры и библиотеки разработчика, необходимые для @@ -379,7 +368,7 @@ Summary(ru.UTF-8): MySQL - статические библиотеки Summary(uk.UTF-8): MySQL - статичні бібліотеки Group: Development/Libraries Requires: %{name}-devel = %{version}-%{release} -Obsoletes: MySQL-static +Obsoletes: MySQL-static < 3.22.27 %description static MySQL static libraries. @@ -404,8 +393,8 @@ Summary(uk.UTF-8): MySQL - бенчмарки Group: Applications/Databases Requires: %{name} = %{version}-%{release} Requires: %{name}-client -Requires: perl(DBD::mysql) -Obsoletes: MySQL-bench +Requires: perl-DBD-mysql +Obsoletes: MySQL-bench < 3.22.27 %description bench This package contains MySQL benchmark scripts and data. @@ -414,16 +403,14 @@ This package contains MySQL benchmark scripts and data. Programy testujące szybkość serwera MySQL. %description bench -l pt_BR.UTF-8 -Este pacote contém medições de desempenho de scripts e dados do -MySQL. +Este pacote contém medições de desempenho de scripts e dados do MySQL. %description bench -l ru.UTF-8 Этот пакет содержит скрипты и данные для оценки производительности MySQL. %description bench -l uk.UTF-8 -Цей пакет містить скрипти та дані для оцінки продуктивності Percona -Server. +Цей пакет містить скрипти та дані для оцінки продуктивності MySQL. %package doc Summary: MySQL manual @@ -443,8 +430,7 @@ Group: Applications/Databases Requires: %{name}-libs = %{version}-%{release} %description ndb -This package contains the standard MySQL NDB Storage Engine -Daemon. +This package contains the standard MySQL NDB Storage Engine Daemon. %description ndb -l pl.UTF-8 Ten pakiet zawiera standardowego demona silnika przechowywania danych @@ -469,12 +455,10 @@ Group: Applications/Databases Requires: %{name}-libs = %{version}-%{release} %description ndb-mgm -This package contains the standard MySQL NDB Management -Daemon. +This package contains the standard MySQL NDB Management Daemon. %description ndb-mgm -l pl.UTF-8 -Ten pakiet zawiera standardowego demona zarządzającego MySQL -NDB. +Ten pakiet zawiera standardowego demona zarządzającego MySQL NDB. %package ndb-cpc Summary: MySQL - NDB CPC Daemon @@ -489,32 +473,32 @@ This package contains the standard MySQL NDB CPC Daemon. Ten pakiet zawiera standardowego demona MySQL NDB CPC. %prep -%setup -q -n percona-server-%{version}-%{percona_rel} %{?with_sphinx:-a100} %{!?with_system_boost:-a101} +%setup -q %{?with_sphinx:-a100} %{!?with_system_boost:-a101} -n mysql-%{version} -# we want to use old, mysql compatible client library name -find . -name CMakeLists.txt -exec sed -i -e 's#perconaserverclient#mysqlclient#g' "{}" ";" -sed -i -e 's#perconaserverclient#mysqlclient#g' libmysql/libmysql.{ver.in,map} scripts/mysql_config.* +#%patch0 -p1 +# FIXME +#%patch1 -p1 -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %if %{with sphinx} # http://www.sphinxsearch.com/docs/manual-0.9.9.html#sphinxse-mysql51 %{__mv} sphinx-*/mysqlse storage/sphinx -%patch4 -p1 -%patch5 -p1 +%patch17 -p1 +%patch18 -p1 %endif -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 + +%patch24 -p1 +%patch25 -p1 + +#%patch26 -p1 # to get these files rebuild [ -f sql/sql_yacc.cc ] && %{__rm} sql/sql_yacc.cc [ -f sql/sql_yacc.h ] && %{__rm} sql/sql_yacc.h -# map has more sane versioning that default "global everything" in ver.in -#cp -p libmysql/libmysql.map libmysql/libmysql.ver.in +# ensure sytstem lib +# need to keep xxhash.[ch] +# FIXME +#%{__rm} -rv extra/lz4/lz4** %build install -d build @@ -523,96 +507,73 @@ cd build # (it defaults to first cluster but user may change it to whatever # cluster it wants) -%if "%{cc_version}" >= "7.0" -FALLTHROUGH_OPT="-Wimplicit-fallthrough=0" -%else -FALLTHROUGH_OPT= -%endif - CPPFLAGS="%{rpmcppflags}" \ %cmake .. \ + -DCMAKE_EXECUTABLE_SUFFIX=string:%{majorver} \ -DCMAKE_BUILD_TYPE=%{!?debug:RelWithDebInfo}%{?debug:Debug} \ - -DCMAKE_C_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT" \ - -DCMAKE_CXX_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT" \ - -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{rpmcflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT -Wno-shadow" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{rpmcxxflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT -Wno-shadow" \ - -DCOMPILATION_COMMENT="TLD Linux MySQL RPM" \ + -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{rpmcflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{rpmcxxflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing" \ + -DCOMPILATION_COMMENT="PLD/Linux Distribution MySQL RPM" \ -DCURSES_INCLUDE_PATH=/usr/include/ncurses \ %{?with_systemtap:-DENABLE_DTRACE=ON} \ -DFEATURE_SET="community" \ -DINSTALL_LAYOUT=RPM \ -DINSTALL_LIBDIR=%{_lib} \ + -DINSTALL_PRIV_LIBDIR=%{_libdir}/%{name}/private \ -DINSTALL_MYSQLTESTDIR_RPM="" \ -DINSTALL_PLUGINDIR=%{_lib}/%{name}/plugin \ + -DINSTALL_SECURE_FILE_PRIVDIR=/var/lib/%{name}-files \ -DINSTALL_SQLBENCHDIR=%{_datadir} \ -DINSTALL_SUPPORTFILESDIR=share/%{name}-support \ -DINSTALL_MYSQLSHAREDIR=share/%{name} \ - -DINSTALL_SECURE_FILE_PRIVDIR="" \ - -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \ + -DROUTER_INSTALL_LIBDIR=%{_libdir}/%{name}router/private \ + -DROUTER_INSTALL_PLUGINDIR=%{_libdir}/%{name}router \ + -DMYSQL_UNIX_ADDR=/var/lib/%{name}/mysql.sock \ %{?debug:-DWITH_DEBUG=ON} \ -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ - -DWITH_FAST_MUTEXES=ON \ + %{!?with_ldap:-DWITH_AUTHENTICATION_LDAP=OFF} \ -DWITH_LIBWRAP=%{?with_tcpd:ON}%{!?with_tcpd:OFF} \ - -DWITH_PAM=ON \ -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ -DWITH_PIC=ON \ - -DWITH_SCALABILITY_METRICS=ON \ - -DWITH_SSL=%{?with_ssl:system}%{!?with_ssl:no} \ - -DWITH_UNIT_TESTS=%{?with_tests:ON}%{!?with_tests:OFF} \ - -DWITH_COREDUMPER=%{?with_coredumper:ON}%{!?with_coredumper:OFF} \ - %{!?with_tokudb:-DWITHOUT_TOKUDB=ON} \ - %{!?with_rocksdb:-DWITHOUT_ROCKSDB=ON} \ -%if %{without system_boost} - %{!?with_system_boost:-DWITH_BOOST="$(pwd)/$(ls -1d ../boost_*)"} \ -%endif + %{?with_ldap:-DWITH_LDAP=system} \ + -DWITH_KERBEROS=system \ -DWITH_LIBEVENT=system \ -DWITH_LZ4=system \ - -DWITH_MECAB=system \ -DWITH_PROTOBUF=system \ - -DWITH_READLINE=system \ + -DWITH_SASL=system \ + -DWITH_UNIT_TESTS=%{?with_tests:ON}%{!?with_tests:OFF} \ + -DWITH_SSL=%{?with_ssl:system}%{!?with_ssl:no} \ + %{!?with_system_boost:-DWITH_BOOST="$(pwd)/$(ls -1d ../boost_*)"} \ -DWITH_ZLIB=system \ + -DWITH_EDITLINE=system \ + -DWITH_MECAB=system \ -DTMPDIR=/var/tmp %{__make} -%if %{with tests} -%{__make} test - -cd mysql-test - -MTR_BINDIR=$(pwd)/../build/ \ -%{__perl} ./mysql-test-run.pl \ - --force \ - --retry=0 \ - --ssl \ - --suite-timeout=720 \ - --testcase-timeout=30 \ - --mysqld=--binlog-format=mixed \ - --force-restart \ - --shutdown-timeout=60 \ - --max-test-fail=0 \ - --big-test \ - --skip-test-list=unstable-tests -%endif +%{?with_tests:%{__make} test} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,%{name},skel} \ - $RPM_BUILD_ROOT/var/{log/{archive,}/%{name},lib/mysql} \ + $RPM_BUILD_ROOT/var/{log/{archive,}/%{name},lib/{%{name},%{name}-files}} \ $RPM_BUILD_ROOT%{_mysqlhome} \ $RPM_BUILD_ROOT%{_libdir} %{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT -install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} +sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} + cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} -cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} +sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE3} > $RPM_BUILD_ROOT/etc/logrotate.d/%{name} # This is template for configuration file which is created after 'service mysql init' -cp -a %{SOURCE4} mysqld.conf -cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/clusters.conf +sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE4} > mysqld.conf +sed -e 's#{MYSQL_MAJOR}#%{majorver}#g' %{SOURCE5} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/clusters.conf touch $RPM_BUILD_ROOT/var/log/%{name}/{mysqld,query,slow}.log +mv $RPM_BUILD_ROOT/etc/logrotate.d/{mysqlrouter,%{name}router} + # remove innodb directives from mysqld.conf if mysqld is configured without %if %{without innodb} cp mysqld.conf mysqld.tmp @@ -646,62 +607,68 @@ sed -i -e '/libs/s/-lprobes_mysql//' $RPM_BUILD_ROOT%{_bindir}/mysql_config %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}-support # rename not to be so generic name -mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump -mv $RPM_BUILD_ROOT%{_mandir}/man1/{,mysql_}resolve_stack_dump.1 - -# move to _sysconfdir -#mv $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}}/mysqlaccess.conf # not useful without -debug build -%{!?debug:%{__rm} $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump} -%{!?debug:%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/mysql_resolve_stack_dump.1} # generate symbols file, so one can generate backtrace using it # mysql_resolve_stack_dump -s %{_datadir}/%{name}/mysqld.sym -n mysqld.stack. # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/%{name}/mysqld.sym} # do not clobber users $PATH -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_plugin -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_upgrade -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/innochecksum -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamchk -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamlog -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisampack -#mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_fix_privilege_tables -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/my_print_defaults -sed -i -e 's#/usr/bin/my_print_defaults#%{_sbindir}/my_print_defaults#g' $RPM_BUILD_ROOT%{_bindir}/mysql_install_db -mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysqlcheck +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_upgrade +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/innochecksum +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamchk +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamlog +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisampack +#%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_fix_privilege_tables +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/my_print_defaults +%{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysqlcheck # delete - functionality in initscript / rpm # note: mysql_install_db (and thus resolveip) are needed by digikam %{__rm} $RPM_BUILD_ROOT%{_bindir}/mysqld_safe %{__rm} $RPM_BUILD_ROOT%{_bindir}/mysqld_multi %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}* -%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg-utf8.txt +#%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate +#%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server +#%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server* %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1* %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/comp_err.1* # we don't package those (we have no -test or -testsuite pkg) and some of them just segfault -%{__rm} $RPM_BUILD_ROOT%{_bindir}/mysql_client_test +%{__rm} $RPM_BUILD_ROOT%{_bindir}/{mysql_client_test,mysqlxtest} +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/test_udf_services.so +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/component_test_udf_services.so %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/mysql-test -# libmysqld examples -%{__rm} $RPM_BUILD_ROOT%{_bindir}/mysql{_client_test_embedded,_embedded,test_embedded} # not needed %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/libdaemon_example.* %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/daemon_example.ini -%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/udf_example.so -# not an .info file -%{__rm} $RPM_BUILD_ROOT%{_infodir}/mysql.info +# test plugins +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/libtest*.so +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/rewrite_example.so +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/test_security_context.so + +# fix names for parallel coinstallation +for f in $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/* ; do + fb=$(basename "$f") + mv "${f}" "${f}%{majorver}" + for m in $RPM_BUILD_ROOT%{_mandir}/man*; do + mnr=$(echo -n $m | tail -c 1) + if [ -f "${m}/${fb}.${mnr}" ]; then + mv "${m}/${fb}.${mnr}" "$m/${fb}%{majorver}.${mnr}" + fi + done +done %clean rm -rf $RPM_BUILD_ROOT %pre %groupadd -g 89 mysql -%useradd -u 89 -d %{_mysqlhome} -s /bin/false -g mysql -c "MySQL Server" mysql +%useradd -u 89 -d %{_mysqlhome} -s /bin/false -g mysql -c "%{name} Server" mysql %post /sbin/ldconfig @@ -743,7 +710,7 @@ fi %post ndb-cpc /sbin/chkconfig --add %{name}-ndb-cpc -%service %{name}-ndb-cpc restart "mysql NDB CPC" +%service %{name}-ndb-cpc restart "%{name} NDB CPC" %preun ndb-cpc if [ "$1" = "0" ]; then @@ -751,115 +718,113 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del %{name}-ndb-cpc fi -%post libs -p /sbin/ldconfig -%postun libs -p /sbin/ldconfig +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig %files %defattr(644,root,root,755) -%doc build-ps/rpm/*.cnf %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}router %attr(754,root,root) /etc/rc.d/init.d/%{name} %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/clusters.conf -%attr(755,root,root) %{_bindir}/ps_mysqld_helper -%attr(755,root,root) %{_bindir}/ps_tokudb_admin -%attr(755,root,root) %{_bindir}/ps-admin -%attr(755,root,root) %{_sbindir}/innochecksum -%attr(755,root,root) %{_sbindir}/my_print_defaults -%attr(755,root,root) %{_sbindir}/myisamchk -%attr(755,root,root) %{_sbindir}/myisamlog -%attr(755,root,root) %{_sbindir}/myisampack -%attr(755,root,root) %{_sbindir}/mysql_plugin -%attr(755,root,root) %{_sbindir}/mysql_upgrade -%attr(755,root,root) %{_sbindir}/mysqlcheck -%attr(755,root,root) %{_sbindir}/mysqld +%attr(755,root,root) %{_bindir}/ibd2sdi%{majorver} +%attr(755,root,root) %{_bindir}/mysql_migrate_keyring%{majorver} +%attr(755,root,root) %{_bindir}/mysqlrouter%{majorver} +%attr(755,root,root) %{_bindir}/mysqlrouter_keyring%{majorver} +%attr(755,root,root) %{_bindir}/mysqlrouter_passwd%{majorver} +%attr(755,root,root) %{_bindir}/mysqlrouter_plugin_info%{majorver} +%attr(755,root,root) %{_sbindir}/innochecksum%{majorver} +%attr(755,root,root) %{_sbindir}/my_print_defaults%{majorver} +%attr(755,root,root) %{_sbindir}/myisamchk%{majorver} +%attr(755,root,root) %{_sbindir}/myisamlog%{majorver} +%attr(755,root,root) %{_sbindir}/myisampack%{majorver} +%attr(755,root,root) %{_sbindir}/mysql_upgrade%{majorver} +%attr(755,root,root) %{_sbindir}/mysqlcheck%{majorver} +%attr(755,root,root) %{_sbindir}/mysqld%{majorver} + %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugin %attr(755,root,root) %{_libdir}/%{name}/plugin/adt_null.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/audit_log.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/auth_pam_compat.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/auth_pam.so %attr(755,root,root) %{_libdir}/%{name}/plugin/auth.so %attr(755,root,root) %{_libdir}/%{name}/plugin/auth_socket.so %attr(755,root,root) %{_libdir}/%{name}/plugin/auth_test_plugin.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/authentication_ldap_sasl_client.so +#%attr(755,root,root) %{_libdir}/%{name}/plugin/authentication_fido_client.so +#%{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/plugin/authentication_ldap_sasl_client.so} +#%attr(755,root,root) %{_libdir}/%{name}/plugin/authentication_oci_client.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_audit_api_message_emit.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_keyring_file.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_log_filter_dragnet.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_log_sink_json.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_log_sink_syseventlog.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_mysqlbackup.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_mysqlx_global_reset.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_pfs_example.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_pfs_example_component_population.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_query_attributes.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_reference_cache.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_udf_*_func.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_validate_password.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/conflicting_variables.so %attr(755,root,root) %{_libdir}/%{name}/plugin/connection_control.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/data_masking.ini -%attr(755,root,root) %{_libdir}/%{name}/plugin/data_masking.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/dialog.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/ddl_rewriter.so %attr(755,root,root) %{_libdir}/%{name}/plugin/group_replication.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/ha_mock.so %attr(755,root,root) %{_libdir}/%{name}/plugin/keyring_file.so %attr(755,root,root) %{_libdir}/%{name}/plugin/keyring_udf.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/keyring_vault.so %attr(755,root,root) %{_libdir}/%{name}/plugin/libpluginmecab.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libfnv1a_udf.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libfnv_udf.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libmurmur_udf.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_framework.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_services.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_services_threaded.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_session_detach.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_session_info.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_session_in_thd.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_2_sessions.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_all_col_types.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_cmds_1.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_commit.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_complex.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_errors.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_lock.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_processlist.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_replication.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_shutdown.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_sqlmode.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_stored_procedures_functions.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_sql_views_triggers.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_x_sessions_deinit.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/libtest_x_sessions_init.so %attr(755,root,root) %{_libdir}/%{name}/plugin/locking_service.so %attr(755,root,root) %{_libdir}/%{name}/plugin/mypluglib.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/mysql_clone.so %attr(755,root,root) %{_libdir}/%{name}/plugin/mysql_no_login.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/mysqlx.so %attr(755,root,root) %{_libdir}/%{name}/plugin/qa_auth_client.so %attr(755,root,root) %{_libdir}/%{name}/plugin/qa_auth_interface.so %attr(755,root,root) %{_libdir}/%{name}/plugin/qa_auth_server.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/query_response_time.so %attr(755,root,root) %{_libdir}/%{name}/plugin/replication_observers_example_plugin.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/rewrite_example.so %attr(755,root,root) %{_libdir}/%{name}/plugin/rewriter.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/scalability_metrics.so %attr(755,root,root) %{_libdir}/%{name}/plugin/semisync_master.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/semisync_replica.so %attr(755,root,root) %{_libdir}/%{name}/plugin/semisync_slave.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/test_security_context.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/test_udf_services.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/semisync_source.so %attr(755,root,root) %{_libdir}/%{name}/plugin/validate_password.so %attr(755,root,root) %{_libdir}/%{name}/plugin/version_token.so %if %{with sphinx} %attr(755,root,root) %{_libdir}/%{name}/plugin/ha_sphinx.so %endif -%if %{with tokudb} -%attr(755,root,root) %{_bindir}/tokuft_logprint -%attr(755,root,root) %{_bindir}/tokuftdump -%attr(755,root,root) %{_libdir}/%{name}/plugin/ha_tokudb.so -%attr(755,root,root) %{_libdir}/%{name}/plugin/tokudb_backup.so -%attr(755,root,root) %{_libdir}/libHotBackup.so -%endif -%if %{with rocksdb} -%attr(755,root,root) %{_bindir}/ldb -%attr(755,root,root) %{_bindir}/mysql_ldb -%attr(755,root,root) %{_bindir}/sst_dump -%attr(755,root,root) %{_libdir}/%{name}/plugin/ha_rocksdb.so -%endif -# for plugins -%{_mandir}/man1/innochecksum.1* -%{_mandir}/man1/my_print_defaults.1* -%{_mandir}/man1/myisamchk.1* -%{_mandir}/man1/myisamlog.1* -%{_mandir}/man1/myisampack.1* -%{_mandir}/man1/mysql_plugin.1* -%{_mandir}/man1/mysql_upgrade.1* -%{_mandir}/man1/mysqlcheck.1* -%{_mandir}/man8/mysqld.8* +%dir %{_libdir}/%{name}/private +%{_libdir}/%{name}/private/icudt*l +%dir %{_libdir}/%{name}router +%attr(755,root,root) %{_libdir}/%{name}router/connection_pool.so +%attr(755,root,root) %{_libdir}/%{name}router/destination_status.so +%attr(755,root,root) %{_libdir}/%{name}router/http_auth_backend.so +%attr(755,root,root) %{_libdir}/%{name}router/http_auth_realm.so +%attr(755,root,root) %{_libdir}/%{name}router/http_server.so +%attr(755,root,root) %{_libdir}/%{name}router/io.so +%attr(755,root,root) %{_libdir}/%{name}router/keepalive.so +%attr(755,root,root) %{_libdir}/%{name}router/metadata_cache.so +%attr(755,root,root) %{_libdir}/%{name}router/rest_api.so +%attr(755,root,root) %{_libdir}/%{name}router/rest_connection_pool.so +%attr(755,root,root) %{_libdir}/%{name}router/rest_metadata_cache.so +%attr(755,root,root) %{_libdir}/%{name}router/rest_router.so +%attr(755,root,root) %{_libdir}/%{name}router/rest_routing.so +%attr(755,root,root) %{_libdir}/%{name}router/router_openssl.so +%attr(755,root,root) %{_libdir}/%{name}router/router_protobuf.so +%attr(755,root,root) %{_libdir}/%{name}router/routing.so +%dir %{_libdir}/%{name}router/private +%attr(755,root,root) %{_libdir}/%{name}router/private/libmysqlharness*.so* +%attr(755,root,root) %{_libdir}/%{name}router/private/libmysqlrouter*.so* +%{_mandir}/man1/ibd2sdi%{majorver}.1* +%{_mandir}/man1/innochecksum%{majorver}.1* +%{_mandir}/man1/my_print_defaults%{majorver}.1* +%{_mandir}/man1/myisamchk%{majorver}.1* +%{_mandir}/man1/myisamlog%{majorver}.1* +%{_mandir}/man1/myisampack%{majorver}.1* +%{_mandir}/man1/mysql_upgrade%{majorver}.1* +%{_mandir}/man1/mysqlcheck%{majorver}.1* +%{_mandir}/man1/mysqlrouter%{majorver}.1* +%{_mandir}/man1/mysqlrouter_passwd%{majorver}.1* +%{_mandir}/man1/mysqlrouter_plugin_info%{majorver}.1* +%{_mandir}/man8/mysqld%{majorver}.8* %if %{?debug:1}0 %attr(755,root,root) %{_bindir}/*resolve_stack_dump @@ -869,25 +834,21 @@ fi %attr(700,mysql,mysql) %{_mysqlhome} # root:root is proper here for mysql.rpm while mysql:mysql is potential security hole -%attr(751,root,root) /var/lib/mysql +%attr(751,root,root) /var/lib/%{name} +%attr(750,mysql,mysql) %dir /var/lib/%{name}-files %attr(750,mysql,mysql) %dir /var/log/%{name} %attr(750,mysql,mysql) %dir /var/log/archive/%{name} %attr(640,mysql,mysql) %ghost /var/log/%{name}/* # This is template for configuration file which is created after 'service mysql init' %{_datadir}/%{name}/mysqld.conf -%{_datadir}/%{name}/install_rewriter.sql -%{_datadir}/%{name}/mysql_security_commands.sql -%{_datadir}/%{name}/mysql_sys_schema.sql -%{_datadir}/%{name}/mysql_system_tables.sql -%{_datadir}/%{name}/mysql_system_tables_data.sql -%{_datadir}/%{name}/mysql_test_data_timezone.sql -%{_datadir}/%{name}/uninstall_rewriter.sql %{_datadir}/%{name}/english %{_datadir}/%{name}/dictionary.txt -%{_datadir}/%{name}/fill_help_tables.sql -%{_datadir}/%{name}/innodb_memcached_config.sql +%{_datadir}/%{name}/messages_to_clients.txt +%{_datadir}/%{name}/messages_to_error_log.txt +%{_datadir}/%{name}/install_rewriter.sql +%{_datadir}/%{name}/uninstall_rewriter.sql # Don't mark these with %%lang. These are used depending # on database client settings. %{_datadir}/%{name}/bulgarian @@ -921,51 +882,41 @@ fi %files extras %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/myisam_ftdump -%attr(755,root,root) %{_bindir}/mysql_install_db -%attr(755,root,root) %{_bindir}/mysql_secure_installation -%attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql -%attr(755,root,root) %{_bindir}/perror -%attr(755,root,root) %{_bindir}/replace -%attr(755,root,root) %{_bindir}/resolveip -%{_mandir}/man1/myisam_ftdump.1* -%{_mandir}/man1/mysql_install_db.1* -%{_mandir}/man1/mysql_secure_installation.1* -%{_mandir}/man1/mysql_tzinfo_to_sql.1* -%{_mandir}/man1/perror.1* -%{_mandir}/man1/replace.1* -%{_mandir}/man1/resolveip.1* +%attr(755,root,root) %{_bindir}/myisam_ftdump%{majorver} +%attr(755,root,root) %{_bindir}/mysql_secure_installation%{majorver} +%attr(755,root,root) %{_bindir}/mysql_ssl_rsa_setup%{majorver} +%attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql%{majorver} +%attr(755,root,root) %{_bindir}/perror%{majorver} +%{_mandir}/man1/myisam_ftdump%{majorver}.1* +%{_mandir}/man1/mysql_ssl_rsa_setup%{majorver}.1* +%{_mandir}/man1/mysql_secure_installation%{majorver}.1* +%{_mandir}/man1/mysql_tzinfo_to_sql%{majorver}.1* +%{_mandir}/man1/perror%{majorver}.1* %files extras-perl %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/mysqldumpslow -%{_mandir}/man1/mysqldumpslow.1* +%attr(755,root,root) %{_bindir}/mysqldumpslow%{majorver} +%{_mandir}/man1/mysqldumpslow%{majorver}.1* %files client %defattr(644,root,root,755) -%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/skel/.my.cnf -%attr(755,root,root) %{_bindir}/lz4_decompress -%attr(755,root,root) %{_bindir}/mysql -%attr(755,root,root) %{_bindir}/mysql_config_editor -%attr(755,root,root) %{_bindir}/mysql_ssl_rsa_setup -%attr(755,root,root) %{_bindir}/mysqladmin -%attr(755,root,root) %{_bindir}/mysqlbinlog -%attr(755,root,root) %{_bindir}/mysqldump -%attr(755,root,root) %{_bindir}/mysqlimport -%attr(755,root,root) %{_bindir}/mysqlpump -%attr(755,root,root) %{_bindir}/mysqlshow -%attr(755,root,root) %{_bindir}/zlib_decompress -%{_mandir}/man1/lz4_decompress.1* -%{_mandir}/man1/mysql.1* -%{_mandir}/man1/mysql_config_editor.1* -%{_mandir}/man1/mysql_ssl_rsa_setup.1* -%{_mandir}/man1/mysqladmin.1* -%{_mandir}/man1/mysqlbinlog.1* -%{_mandir}/man1/mysqldump.1* -%{_mandir}/man1/mysqlimport.1* -%{_mandir}/man1/mysqlpump.1* -%{_mandir}/man1/mysqlshow.1* -%{_mandir}/man1/zlib_decompress.1* +%attr(600,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) /etc/skel/.my.cnf +%attr(755,root,root) %{_bindir}/mysql%{majorver} +%attr(755,root,root) %{_bindir}/mysqladmin%{majorver} +%attr(755,root,root) %{_bindir}/mysqlbinlog%{majorver} +%attr(755,root,root) %{_bindir}/mysql_config_editor%{majorver} +%attr(755,root,root) %{_bindir}/mysqldump%{majorver} +%attr(755,root,root) %{_bindir}/mysqlimport%{majorver} +%attr(755,root,root) %{_bindir}/mysqlpump%{majorver} +%attr(755,root,root) %{_bindir}/mysqlshow%{majorver} +%{_mandir}/man1/mysql%{majorver}.1* +%{_mandir}/man1/mysqladmin%{majorver}.1* +%{_mandir}/man1/mysqlbinlog%{majorver}.1* +%{_mandir}/man1/mysql_config_editor%{majorver}.1* +%{_mandir}/man1/mysqldump%{majorver}.1* +%{_mandir}/man1/mysqlimport%{majorver}.1* +%{_mandir}/man1/mysqlpump%{majorver}.1* +%{_mandir}/man1/mysqlshow%{majorver}.1* %files libs %defattr(644,root,root,755) @@ -973,7 +924,7 @@ fi %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mysql-client.conf %{_sysconfdir}/%{name}/my.cnf %attr(755,root,root) %{_libdir}/libmysqlclient.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libmysqlclient.so.20 +%attr(755,root,root) %ghost %{_libdir}/libmysqlclient.so.22 %if %{with ndb} %attr(755,root,root) %{_libdir}/libndbclient.so.*.*.* %attr(755,root,root) %ghost %{_libdir}/libndbclient.so.3 @@ -981,18 +932,16 @@ fi %files devel %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/mysql_config +%attr(755,root,root) %{_bindir}/mysql_config%{majorver} %attr(755,root,root) %{_libdir}/libmysqlclient.so -%{_pkgconfigdir}/mysqlclient.pc %if %{with ndb} %attr(755,root,root) %{_libdir}/libndbclient.so %endif -# static-only so far -%{_libdir}/libmysqld.a +%{_pkgconfigdir}/mysqlclient.pc %{_libdir}/libmysqlservices.a %{_includedir}/mysql %{_aclocaldir}/mysql.m4 -%{_mandir}/man1/mysql_config.1* +%{_mandir}/man1/mysql_config%{majorver}.1* %files static %defattr(644,root,root,755) @@ -1001,68 +950,115 @@ fi %{_libdir}/libndbclient.a %endif +# rename to test or split? %files bench %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/mysqlslap -%attr(755,root,root) %{_bindir}/mysqltest -%{_mandir}/man1/mysqlslap.1* +%attr(755,root,root) %{_bindir}/comp_err%{majorver} +%attr(755,root,root) %{_bindir}/mysql_keyring_encryption_test%{majorver} +%attr(755,root,root) %{_bindir}/mysqlslap%{majorver} +%attr(755,root,root) %{_bindir}/mysqltest%{majorver} +%attr(755,root,root) %{_bindir}/mysqltest_safe_process%{majorver} +%attr(755,root,root) %{_bindir}/zlib_decompress%{majorver} +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_example_component1.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_example_component2.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_example_component3.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_log_sink_test.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_audit_api_message.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_backup_lock_service.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_component_deinit.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_host_application_signal.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_mysql_current_thread_reader.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_mysql_runtime_error.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_mysql_system_variable_set.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_pfs_notification.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_pfs_resource_group.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_sensitive_system_variables.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_status_var_service.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_status_var_service_int.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_status_var_service_reg_only.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_status_var_service_str.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_status_var_service_unreg_only.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_string_service.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_string_service_charset.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_string_service_long.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_sys_var_service.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_sys_var_service_int.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_sys_var_service_same.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_sys_var_service_str.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_system_variable_source.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_table_access.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/component_test_udf_registration.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/pfs_example_plugin_employee.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/test_services_host_application_signal.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/test_services_plugin_registry.so +%attr(755,root,root) %{_libdir}/%{name}/plugin/udf_example.so +#%dir %{_datadir}/sql-bench +#%{_datadir}/sql-bench/[CDRl]* +#%attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]* +%{_mandir}/man1/lz4_decompress.1* +%{_mandir}/man1/mysqlslap%{majorver}.1* +%{_mandir}/man1/zlib_decompress%{majorver}.1* + +#%files doc +#%defattr(644,root,root,755) +#%doc Docs/manual.html Docs/manual_toc.html %if %{with ndb} %files ndb %defattr(644,root,root,755) -%attr(755,root,root) %{_sbindir}/ndbd +%attr(755,root,root) %{_sbindir}/ndbd%{majorver} %attr(754,root,root) /etc/rc.d/init.d/%{name}-ndb -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-ndb -%{_mandir}/man1/ndbd_redo_log_reader.1* -%{_mandir}/man8/ndbd.8* +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb +%{_mandir}/man1/ndbd_redo_log_reader%{majorver}.1* +%{_mandir}/man8/ndbd%{majorver}.8* %files ndb-client %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/ndb_config -%attr(755,root,root) %{_bindir}/ndb_delete_all -%attr(755,root,root) %{_bindir}/ndb_desc -%attr(755,root,root) %{_bindir}/ndb_drop_index -%attr(755,root,root) %{_bindir}/ndb_drop_table -%attr(755,root,root) %{_bindir}/ndb_error_reporter -%attr(755,root,root) %{_bindir}/ndb_mgm -%attr(755,root,root) %{_bindir}/ndb_print_backup_file -%attr(755,root,root) %{_bindir}/ndb_print_schema_file -%attr(755,root,root) %{_bindir}/ndb_print_sys_file -%attr(755,root,root) %{_bindir}/ndb_restore -%attr(755,root,root) %{_bindir}/ndb_select_all -%attr(755,root,root) %{_bindir}/ndb_select_count -%attr(755,root,root) %{_bindir}/ndb_show_tables -%attr(755,root,root) %{_bindir}/ndb_size.pl -%attr(755,root,root) %{_bindir}/ndb_test_platform -%attr(755,root,root) %{_bindir}/ndb_waiter -%{_mandir}/man1/ndb_config.1* -%{_mandir}/man1/ndb_delete_all.1* -%{_mandir}/man1/ndb_desc.1* -%{_mandir}/man1/ndb_drop_index.1* -%{_mandir}/man1/ndb_drop_table.1* -%{_mandir}/man1/ndb_error_reporter.1* -%{_mandir}/man1/ndb_mgm.1* -%{_mandir}/man1/ndb_print_backup_file.1* -%{_mandir}/man1/ndb_print_schema_file.1* -%{_mandir}/man1/ndb_print_sys_file.1* -%{_mandir}/man1/ndb_restore.1* -%{_mandir}/man1/ndb_select_all.1* -%{_mandir}/man1/ndb_select_count.1* -%{_mandir}/man1/ndb_show_tables.1* -%{_mandir}/man1/ndb_size.pl.1* -%{_mandir}/man1/ndb_waiter.1* +%attr(755,root,root) %{_bindir}/ndb_config%{majorver} +%attr(755,root,root) %{_bindir}/ndb_delete_all%{majorver} +%attr(755,root,root) %{_bindir}/ndb_desc%{majorver} +%attr(755,root,root) %{_bindir}/ndb_drop_index%{majorver} +%attr(755,root,root) %{_bindir}/ndb_drop_table%{majorver} +%attr(755,root,root) %{_bindir}/ndb_error_reporter%{majorver} +%attr(755,root,root) %{_bindir}/ndb_mgm%{majorver} +%attr(755,root,root) %{_bindir}/ndb_print_backup_file%{majorver} +%attr(755,root,root) %{_bindir}/ndb_print_schema_file%{majorver} +%attr(755,root,root) %{_bindir}/ndb_print_sys_file%{majorver} +%attr(755,root,root) %{_bindir}/ndb_restore%{majorver} +%attr(755,root,root) %{_bindir}/ndb_select_all%{majorver} +%attr(755,root,root) %{_bindir}/ndb_select_count%{majorver} +%attr(755,root,root) %{_bindir}/ndb_show_tables%{majorver} +%attr(755,root,root) %{_bindir}/ndb_size.pl%{majorver} +%attr(755,root,root) %{_bindir}/ndb_test_platform%{majorver} +%attr(755,root,root) %{_bindir}/ndb_waiter%{majorver} +%{_mandir}/man1/ndb_config%{majorver}.1* +%{_mandir}/man1/ndb_delete_all%{majorver}.1* +%{_mandir}/man1/ndb_desc%{majorver}.1* +%{_mandir}/man1/ndb_drop_index%{majorver}.1* +%{_mandir}/man1/ndb_drop_table%{majorver}.1* +%{_mandir}/man1/ndb_error_reporter%{majorver}.1* +%{_mandir}/man1/ndb_mgm%{majorver}.1* +%{_mandir}/man1/ndb_print_backup_file%{majorver}.1* +%{_mandir}/man1/ndb_print_schema_file%{majorver}.1* +%{_mandir}/man1/ndb_print_sys_file%{majorver}.1* +%{_mandir}/man1/ndb_restore%{majorver}.1* +%{_mandir}/man1/ndb_select_all%{majorver}.1* +%{_mandir}/man1/ndb_select_count%{majorver}.1* +%{_mandir}/man1/ndb_show_tables%{majorver}.1* +%{_mandir}/man1/ndb_size.pl%{majorver}.1* +%{_mandir}/man1/ndb_waiter%{majorver}.1* %files ndb-mgm %defattr(644,root,root,755) -%attr(755,root,root) %{_sbindir}/ndb_mgmd +%attr(755,root,root) %{_sbindir}/ndb_mgmd%{majorver} %attr(754,root,root) /etc/rc.d/init.d/%{name}-ndb-mgm -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-ndb-mgm -%{_mandir}/man8/ndb_mgmd.8* +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm +%{_mandir}/man8/ndb_mgmd%{majorver}.8* %files ndb-cpc %defattr(644,root,root,755) -%attr(755,root,root) %{_sbindir}/ndb_cpcd -%attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-ndb-cpc -%{_mandir}/man1/ndb_cpcd.1* +%attr(755,root,root) %{_sbindir}/ndb_cpcd%{majorver} +%attr(754,root,root) /etc/rc.d/init.d/%{name}-ndb-cpc +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc +%{_mandir}/man1/ndb_cpcd%{majorver}.1* %endif diff --git a/mysqld.conf b/mysqld.conf index c9da04d..09808af 100644 --- a/mysqld.conf +++ b/mysqld.conf @@ -13,33 +13,11 @@ port = 3306 user = mysql # ssl options -#ssl-ca = /etc/ssl/certs/mysql/ca-cert.pem -#ssl-cert = /etc/ssl/certs/mysql/server-cert.pem -#ssl-key = /etc/ssl/certs/mysql/server-key.pem +#ssl-ca = /etc/ssl/certs/mysql{MYSQL_MAJOR}/ca-cert.pem +#ssl-cert = /etc/ssl/certs/mysql{MYSQL_MAJOR}/server-cert.pem +#ssl-key = /etc/ssl/certs/mysql{MYSQL_MAJOR}/server-key.pem #ssl-cipher = DHE-RSA-AES256-SHA -#character-set-server=latin2 -#collation-server=latin2_general_ci -#skip-character-set-client-handshake - -# This variable controls the password hashing method used by the PASSWORD() -# function. It also influences password hashing performed by CREATE USER and -# GRANT statements that specify a password using an IDENTIFIED BY clause. -# http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_old_passwords -# Value | Password Hashing Method | Associated Authentication Plugin -# 0 | MySQL 4.1 native hashing | mysql_native_password -# 1 | Pre-4.1 ("old") hashing | mysql_old_password -# 2 | SHA-256 hashing | sha256_password -# If you set old_passwords=2, follow the instructions for using the sha256_password plugin at -# http://dev.mysql.com/doc/refman/5.6/en/sha256-authentication-plugin.html -#old-passwords=0 - -# Don't use system locking -skip-external-locking - -# Disabling symbolic-links is recommended to prevent assorted security risks -symbolic-links=0 - # Don't listen on a TCP/IP port at all. This is a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets. @@ -54,64 +32,6 @@ skip-networking # Emergency option. Use only if you really need this. #skip-grant-tables -# http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_default-storage-engine -# Default storage engine is InnoDB since 5.5.5 -# You may revert to previous behaviour by specifiying MyISAM here -#default-storage-engine=MyISAM - -# Replication Master Server (default) -# binary logging is required for replication -#log-bin=mysql-bin - -# max size of master binlog files -#max_binlog_size=256M - -# If non-zero, binary logs will be purged after expire_logs_days days; possible -# purges happen at startup and at binary log rotation. -#expire-logs-days=30 - -# Normally, a slave does not log to its own binary log any updates that are -# received from a master server. This option tells the slave to log the updates -# performed by its SQL thread to its own binary log. For this option to have -# any effect, the slave must also be started with the --log-bin option to -# enable binary logging. --log-slave-updates is used when you want to chain -# replication servers. -#log-slave-updates - -# required unique id between 1 and 2^32 - 1 -# defaults to 1 if master-host is not set but will not function as a master if omitted -#server-id=2 - -# To set up N master servers, set the variables like this: -# Set auto_increment_increment to N on each master. -# Set each of the N masters to have a different auto_increment_offset, using the values 1, 2, ..., N -#auto-increment-offset=1 -#auto-increment-increment=2 - -# databases to be included in binlog -#binlog-do-db=db1 -# or excluded -#binlog-ignore-db=mysql -#binlog-ignore-db=test - -# slave setup -#relay-log=slave-relay-bin -#report-host=db-slave.example.org - -# skip startup of slave -#skip-slave-start - -# master does not ignore them, but we do -#replicate-ignore-db=mysql -#replicate-ignore-db=test -#replicate-ignore-table=db1.tbl1 -#replicate-ignore-table=db2.tbl2 - -#replicate-rewrite-db=delfi->delfi_ro - -# replication local log -#max_relay_log_size=256M - # https://dev.mysql.com/doc/refman/5.6/en/log-destinations.html # global option where logs be written # affects slow-query-log, general-log direcives @@ -123,19 +43,19 @@ skip-networking log-output = FILE # mysqld error log (stderr) -log-error = /var/log/mysql/mysqld.log -log-warnings = 2 +log-error = /var/log/mysql{MYSQL_MAJOR}/mysqld.log +log-error-verbosity = 2 # Log slow queries slow-query-log -slow-query-log-file = /var/log/mysql/slow.log +slow-query-log-file = /var/log/mysql{MYSQL_MAJOR}/slow.log # Log connections and queries. It slows down MySQL so it's disabled by default #general-log -#general-log-file = /var/log/mysql/query.log +#general-log-file = /var/log/mysql{MYSQL_MAJOR}/query.log # Log all updates. -#log-update = /var/log/mysql/update +#log-update = /var/log/mysql{MYSQL_MAJOR}/update # Log some extra information to update log #log-long-format @@ -146,96 +66,6 @@ slow-query-log-file = /var/log/mysql/slow.log # colon (:), in this case they are used in a round-robin fashion. #tmpdir = /var/tmp -# -# Internal server variables -# - -explicit_defaults_for_timestamp = true -#back_log=5 -#connect_timeout=5 -#delayed_insert_timeout=300 -#delayed_insert_limit=100 -#flush_time=0 -#join_buffer_size=131072 -#key_buffer_size=8M -#read_rnd_buffer_size=256K -#read_buffer_size=132K -#long_query_time=10 -#max_allowed_packet=1M -#max_connections=100 -#max_user_connections=0 -#max_connect_errors=10 -#max_delayed_threads=20 -#delayed_queue_size=1000 -#max_join_size=4294967295 -#max_sort_length=1024 -#max_write_lock_count=4294967295 -#net_buffer_length=16384 -#record_buffer=131072 -#sort_buffer_size=2M -#table_cache=64 -#tmp_table_size=1M -#max_heap_table_size=32M -#thread_cache_size=16 -#thread_stack=65536 -# http://www.mysqlperformanceblog.com/2012/06/04/thread_concurrency-doesnt-do-what-you-expect/ -# thread_concurrency is deprecated, removed in 5.6.1 and works on old Solaris versions < 9 -#wait_timeout=28800 -#query_cache_size=8M -#query_cache_limit=1M - -# Fulltext search options -#ft_min_word_len=2 - -# Turn off nonstandard TIMESTAMP behaviors -# http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp -explicit_defaults_for_timestamp = true - -# -# MyISAM tables options -# - -# Don't flush key buffers between writes for any MyISAM -# set this if you have dedicated slave server where writes aren't important -#delay-key-write-for-all-tables - -# Repair automatically on open if the table wasn't closed properly. -# http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_myisam-recover-options -myisam-recover-options -# -#myisam_sort_buffer_size=4M - - -# To completely disable InnoDB, use this option -# this makes all innodb options being unknown options (including skip-innodb) -# @deprecated -#ignore-builtin-innodb - -# -# InnoDB tables options (see MySQL manual) -# -#skip-innodb - -# http://stackoverflow.com/questions/2646373/mysql-data-file-wont-shrink -# http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html -innodb_file_per_table - -# these are actual defaults (as of 5.0.26) -innodb_data_home_dir = @clusterdir@/mysqldb/db -innodb_data_file_path = ibdata1:10M:autoextend -innodb_log_group_home_dir = @clusterdir@/mysqldb/db -innodb_log_files_in_group=2 -innodb_log_file_size=5M -innodb_log_buffer_size=1M - -#innodb_flush_log_at_trx_commit=1 -#innodb_log_arch_dir = @clusterdir@/innodb/log -#innodb_log_archive=0 -#innodb_buffer_pool_size=80M -#innodb_additional_mem_pool_size=10M -#innodb_file_io_threads=4 -#innodb_lock_wait_timeout=50 - # used for logs rotation or status check for replications [client] user = mysql_sysadmin diff --git a/mysqldumpslow-clusters.patch b/mysqldumpslow-clusters.patch new file mode 100644 index 0000000..415ab93 --- /dev/null +++ b/mysqldumpslow-clusters.patch @@ -0,0 +1,46 @@ +--- percona-server-5.6.20-68.0/scripts/mysqldumpslow.sh~ 2014-08-29 10:58:05.000000000 +0300 ++++ percona-server-5.6.20-68.0/scripts/mysqldumpslow.sh 2014-09-06 20:50:22.000000000 +0300 +@@ -51,8 +51,33 @@ + + $opt{'help'} and usage(); + ++# find config file for first defined cluster ++sub get_defaults_file { ++ my $clusters_file = '/etc/mysql/clusters.conf'; ++ return unless -f $clusters_file; ++ ++ open(my $fh , "< $clusters_file") or return; ++ while (<$fh>) { ++ my ($config, $clusterdir) = m{^([^#]+)\s*=\s*(.+)$}; ++ next unless $config; ++ ++ if ($config !~ m{/}) { ++ my $f = "/etc/mysql/$config"; ++ return $f if -f $f; ++ ++ my $f = "$clusterdir/$config"; ++ return $f if -f $f; ++ } ++ return $config; ++ } ++ close($fh) or die $!; ++ return undef; ++} ++ + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults_file = get_defaults_file; ++ my $defaults_arg = "-c $defaults_file" if $defaults_file; ++ my $defaults = `my_print_defaults $defaults_arg mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] + or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; +@@ -61,7 +86,7 @@ + my $slowlog = ($defaults =~ m/--slow-query-log-file=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; ++ my $instances = `my_print_defaults $defaults_arg instances`; + die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); -- 2.44.0