Browse Source

mariadb: bump to major version 10.4

Highlights:

- Bump from 10.2.26 to 10.4.10
- auth_pam got replaced with never version, old one still available as
  auth_pam_v1
- semisync plugins were merged into the core
- Upstream now installs symlinks for binaries with mariadb prefix. To
  accommodate that this commit updates Package/mariadb/install/bin
  accordingly.
- Patches are updated with new ones from Debian and Arch (thanks!)
- libedit patch dropped because it's upstream now.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
lilik-openwrt-22.03
Sebastian Kemper 5 years ago
parent
commit
a90561a90b
10 changed files with 307 additions and 425 deletions
  1. +27
    -13
      utils/mariadb/Makefile
  2. +1
    -1
      utils/mariadb/files/mysqld.init
  3. +1
    -1
      utils/mariadb/patches/100-fix_hostname.patch
  4. +33
    -8
      utils/mariadb/patches/110-pcre.cmake.patch
  5. +45
    -93
      utils/mariadb/patches/130-c11_atomics.patch
  6. +112
    -117
      utils/mariadb/patches/140-mips-connect-unaligned.patch
  7. +9
    -13
      utils/mariadb/patches/160-mips-machine.patch
  8. +40
    -74
      utils/mariadb/patches/170-ppc-remove-glibc-dep.patch
  9. +0
    -105
      utils/mariadb/patches/180-libedit.patch
  10. +39
    -0
      utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch

+ 27
- 13
utils/mariadb/Makefile View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mariadb
PKG_VERSION:=10.2.26
PKG_VERSION:=10.4.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@ -18,7 +18,7 @@ PKG_SOURCE_URL := \
https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \
https://downloads.mariadb.org/interstitial/$(PKG_NAME)-$(PKG_VERSION)/source
PKG_HASH:=152fe941c4f2a352b2b3a4db1ef64e70235fd9ff055af62ad7bda9f2b2191528
PKG_HASH:=cd50fddf86c2a47405737e342f78ebd40d5716f0fb32b976245de713bed01421
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_LICENSE:=GPL-2.0 LGPL-2.1
PKG_LICENSE_FILES:=COPYING THIRDPARTY libmariadb/COPYING.LIB
@ -39,6 +39,8 @@ CONF_DIR:=/etc/mysql
PLUGIN_DIR:=/usr/lib/mariadb/plugin
SHARE_DIR:=/usr/share/mariadb
MARIADB_SOCKET=/var/run/mysqld/mysqld.sock
MARIADB_DISABLE_ENGINES := \
cassandra \
example \
@ -56,7 +58,8 @@ MARIADB_DISABLE_PLUGINS := \
daemon_example \
debug_key_management \
example_key_management \
fulltext
fulltext \
versioning
MARIADB_LIB_PLUGINS := \
auth_gssapi_client
@ -65,6 +68,7 @@ MARIADB_SERVER_PLUGINS := \
auth_ed25519 \
auth_gssapi \
auth_pam \
auth_pam_v1 \
disks \
feedback \
file_key_management \
@ -80,8 +84,6 @@ MARIADB_SERVER_PLUGINS := \
metadata_lock_info \
query_cache_info \
query_response_time \
semisync_master \
semisync_slave \
server_audit \
simple_password_check \
sql_errlog \
@ -97,6 +99,7 @@ plugin-auth_gssapi_client := PLUGIN_AUTH_GSSAPI_CLIENT
plugin-auth_ed25519 := PLUGIN_AUTH_ED25519
plugin-auth_gssapi := PLUGIN_AUTH_GSSAPI
plugin-auth_pam := PLUGIN_AUTH_PAM
plugin-auth_pam_v1 := PLUGIN_AUTH_PAM_V1
plugin-disks := PLUGIN_DISKS
plugin-feedback := PLUGIN_FEEDBACK
plugin-file_key_management := PLUGIN_FILE_KEY_MANAGEMENT
@ -112,8 +115,6 @@ plugin-locales := PLUGIN_LOCALES
plugin-metadata_lock_info := PLUGIN_METADATA_LOCK_INFO
plugin-query_cache_info := PLUGIN_QUERY_CACHE_INFO
plugin-query_response_time := PLUGIN_QUERY_RESPONSE_TIME
plugin-semisync_master := PLUGIN_SEMISYNC_MASTER
plugin-semisync_slave := PLUGIN_SEMISYNC_SLAVE
plugin-server_audit := PLUGIN_SERVER_AUDIT
plugin-simple_password_check := PLUGIN_SIMPLE_PASSWORD_CHECK
plugin-sql_errlog := PLUGIN_SQL_ERRLOG
@ -142,7 +143,11 @@ MARIADB_SERVER := \
mysqld
MARIADB_SERVER_EXTRA := \
aria* \
aria_chk \
aria_dump_log \
aria_ftdump \
aria_pack \
aria_read_log \
mariabackup \
msql2mysql \
myisam_ftdump \
@ -162,7 +167,10 @@ MARIADB_SERVER_EXTRA := \
perror \
replace \
resolve_stack_dump \
wsrep_sst_*
wsrep_sst_mariabackup \
wsrep_sst_mysqldump \
wsrep_sst_rsync \
wsrep_sst_rsync_wan
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
@ -193,6 +201,9 @@ endef
define Package/mariadb/install/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin
cd "$(PKG_INSTALL_DIR)/usr/bin"; find . -maxdepth 1 -type l \
-regex './$(subst mysql,mariadb[-]*,$(subst _,-,$(2)))' \
| xargs -I{} $(CP) {} "$(1)/usr/bin"
endef
define Package/mariadb/install/plugin
@ -411,9 +422,9 @@ CMAKE_OPTIONS += \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SQLBENCHDIR="" \
-DINSTALL_SUPPORTFILESDIR=share/mariadb \
-DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock \
-DINSTALL_UNIX_ADDRDIR=$(MARIADB_SOCKET) \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
-DMYSQL_UNIX_ADDR=$(MARIADB_SOCKET) \
-DSKIP_TESTS=ON \
-DWITH_DEBUG=OFF \
-DWITH_EMBEDDED_SERVER=OFF \
@ -426,6 +437,7 @@ CMAKE_OPTIONS += \
-DWITH_LIBARCHIVE=OFF \
-DWITH_LIBWRAP=OFF \
-DWITH_MARIABACKUP=ON \
-DWITH_NUMA=OFF \
-DWITH_PCRE=system \
-DWITH_SAFEMALLOC=OFF \
-DWITH_SSL=system \
@ -575,12 +587,15 @@ define Package/mariadb-server-base/install
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/mysql_performance_tables.sql $(1)$(SHARE_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/mysql_system_tables.sql $(1)$(SHARE_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/mysql_system_tables_data.sql $(1)$(SHARE_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/mysql_test_db.sql $(1)$(SHARE_DIR)
endef
define Package/mariadb-server-extra/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_common $(1)/usr/bin
$(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_*
$(foreach b,$(MARIADB_SERVER_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
cd $(1)/usr/bin; $(LN) mariabackup mariadb-backup
endef
define BuildPlugin
@ -616,6 +631,7 @@ $(eval $(call BuildPlugin,libmariadb,auth_gssapi_client,+krb5-libs))
$(eval $(call BuildPlugin,mariadb-server,auth_ed25519,))
$(eval $(call BuildPlugin,mariadb-server,auth_gssapi,+krb5-libs))
$(eval $(call BuildPlugin,mariadb-server,auth_pam,+libpam))
$(eval $(call BuildPlugin,mariadb-server,auth_pam_v1,+libpam))
$(eval $(call BuildPlugin,mariadb-server,disks,))
$(eval $(call BuildPlugin,mariadb-server,feedback,))
$(eval $(call BuildPlugin,mariadb-server,file_key_management,))
@ -631,8 +647,6 @@ $(eval $(call BuildPlugin,mariadb-server,locales,))
$(eval $(call BuildPlugin,mariadb-server,metadata_lock_info,))
$(eval $(call BuildPlugin,mariadb-server,query_cache_info,))
$(eval $(call BuildPlugin,mariadb-server,query_response_time,))
$(eval $(call BuildPlugin,mariadb-server,semisync_master,))
$(eval $(call BuildPlugin,mariadb-server,semisync_slave,))
$(eval $(call BuildPlugin,mariadb-server,server_audit,))
$(eval $(call BuildPlugin,mariadb-server,simple_password_check,))
$(eval $(call BuildPlugin,mariadb-server,sql_errlog,))


+ 1
- 1
utils/mariadb/files/mysqld.init View File

@ -131,7 +131,7 @@ start_service() {
}
'
if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
if [ ! -f "$datadir/mysql/tables_priv.MAD" ]; then
local args="--force"
local basedir=$(mysqld_get_param basedir)
[ -n "$basedir" ] && args="$args --basedir=$basedir"


+ 1
- 1
utils/mariadb/patches/100-fix_hostname.patch View File

@ -1,6 +1,6 @@
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -410,7 +410,7 @@ fi
@@ -419,7 +419,7 @@ fi
# Try to determine the hostname


+ 33
- 8
utils/mariadb/patches/110-pcre.cmake.patch View File

@ -1,11 +1,36 @@
From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= <ondrej@debian.org>
Date: Wed, 22 Nov 2017 06:05:45 +0000
Subject: Revert to using system pcre library
---
cmake/pcre.cmake | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
--- a/cmake/pcre.cmake
+++ b/cmake/pcre.cmake
@@ -14,6 +14,8 @@ MACRO (CHECK_PCRE)
return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
}" PCRE_STACK_SIZE_OK)
SET(CMAKE_REQUIRED_LIBRARIES)
+ ELSE()
+ SET(PCRE_STACK_SIZE_OK TRUE)
ENDIF()
@@ -1,23 +1,11 @@
-INCLUDE (CheckCSourceRuns)
-
SET(WITH_PCRE "auto" CACHE STRING
"Which pcre to use (possible values are 'bundled', 'system', or 'auto')")
MACRO (CHECK_PCRE)
IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
- CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE_STACK_GUARD)
- IF(NOT CMAKE_CROSSCOMPILING)
- SET(CMAKE_REQUIRED_LIBRARIES "pcre")
- CHECK_C_SOURCE_RUNS("
- #include <pcre.h>
- int main() {
- return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
- }" PCRE_STACK_SIZE_OK)
- SET(CMAKE_REQUIRED_LIBRARIES)
- ENDIF()
+ CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE)
ENDIF()
IF(NOT HAVE_PCRE_STACK_GUARD OR NOT PCRE_STACK_SIZE_OK OR
- IF(NOT HAVE_PCRE_STACK_GUARD OR NOT PCRE_STACK_SIZE_OK OR
- WITH_PCRE STREQUAL "bundled")
+ IF(NOT HAVE_PCRE OR WITH_PCRE STREQUAL "bundled")
IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre is not found or unusable")
ENDIF()

+ 45
- 93
utils/mariadb/patches/130-c11_atomics.patch View File

@ -1,112 +1,64 @@
Description: Fix mips missing atomics primitives
On mips we don't have native support for 64bit atomic operations. Make use
of libatomic to emulate them.
Author: Vicențiu Ciorbaru <vicentiu@mariadb.org>
Date: Fri Dec 21 19:14:04 2018 +0200
Link with libatomic to enable C11 atomics support
Some architectures (mips) require libatomic to support proper
atomic operations. Check first if support is available without
linking, otherwise use the library.
--- a/configure.cmake
+++ b/configure.cmake
@@ -128,7 +128,7 @@ IF(UNIX)
ENDIF()
FIND_PACKAGE(Threads)
- SET(CMAKE_REQUIRED_LIBRARIES
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES
${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO})
# Need explicit pthread for gcc -fsanitize=address
IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=")
@@ -952,7 +952,26 @@ ELSEIF(NOT WITH_ATOMIC_OPS)
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
}"
- HAVE_GCC_C11_ATOMICS)
+ HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC)
+ IF(HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC)
@@ -866,7 +866,25 @@ int main()
long long int *ptr= &var;
return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
}"
-HAVE_GCC_C11_ATOMICS)
+HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC)
+IF (HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC)
+ SET(HAVE_GCC_C11_ATOMICS True)
+ELSE()
+ SET(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ CHECK_CXX_SOURCE_COMPILES("
+ int main()
+ {
+ long long int var= 1;
+ long long int *ptr= &var;
+ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
+ }"
+ HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ SET(HAVE_GCC_C11_ATOMICS True)
+ ELSE()
+ SET(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ CHECK_CXX_SOURCE_COMPILES("
+ int main()
+ {
+ long long int var= 1;
+ long long int *ptr= &var;
+ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
+ }"
+ HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ SET(HAVE_GCC_C11_ATOMICS True)
+ ELSE()
+ SET(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+ ENDIF()
+ ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!")
ENDIF()
--- a/include/atomic/gcc_builtins.h
+++ b/include/atomic/gcc_builtins.h
@@ -16,6 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+#if defined (HAVE_GCC_ATOMIC_BUILTINS)
#define make_atomic_add_body(S) \
v= __sync_fetch_and_add(a, v);
#define make_atomic_fas_body(S) \
@@ -26,6 +27,20 @@
sav= __sync_val_compare_and_swap(a, cmp_val, set);\
if (!(ret= (sav == cmp_val))) *cmp= sav
+ SET(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+ENDIF()
+#elif defined(HAVE_GCC_C11_ATOMICS)
+
+#define make_atomic_add_body(S) \
+ v= __atomic_fetch_add(a, v, __ATOMIC_SEQ_CST)
+#define make_atomic_fas_body(S) \
+ v= __atomic_exchange_n(a, v, __ATOMIC_SEQ_CST)
+#define make_atomic_cas_body(S) \
+ int ## S sav; \
+ ret= __atomic_compare_exchange_n(a, cmp, set, \
+ 0, \
+ __ATOMIC_SEQ_CST,\
+ __ATOMIC_SEQ_CST);
+#endif
+
#ifdef MY_ATOMIC_MODE_DUMMY
#define make_atomic_load_body(S) ret= *a
#define make_atomic_store_body(S) *a= v
IF(WITH_VALGRIND)
SET(HAVE_valgrind 1)
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -81,6 +81,10 @@ IF(HAVE_BFD_H)
TARGET_LINK_LIBRARIES(mysys bfd)
ENDIF(HAVE_BFD_H)
@@ -72,6 +72,10 @@ TARGET_LINK_LIBRARIES(mysys dbug strings
${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY})
DTRACE_INSTRUMENT(mysys)
+IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ TARGET_LINK_LIBRARIES(mysys atomic)
+ENDIF()
+
IF (WIN32)
TARGET_LINK_LIBRARIES(mysys IPHLPAPI)
ENDIF(WIN32)
IF(HAVE_BFD_H)
TARGET_LINK_LIBRARIES(mysys bfd)
ENDIF(HAVE_BFD_H)
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -170,6 +170,10 @@ TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATI
${SSL_LIBRARIES}
${LIBSYSTEMD})
@@ -190,6 +190,10 @@ ELSE()
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
ENDIF()
+IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC)
+ TARGET_LINK_LIBRARIES(sql atomic)
+ENDIF()
+
IF(WIN32)
SET(MYSQLD_SOURCE main.cc nt_servc.cc message.rc)
TARGET_LINK_LIBRARIES(sql psapi)
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -126,7 +126,7 @@
#include "atomic/generic-msvc.h"
#elif defined(HAVE_SOLARIS_ATOMIC)
#include "atomic/solaris.h"
-#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
+#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_C11_ATOMICS)
#include "atomic/gcc_builtins.h"
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#include "atomic/x86-gcc.h"
IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)

+ 112
- 117
utils/mariadb/patches/140-mips-connect-unaligned.patch View File

@ -1,109 +1,15 @@
Description: Handle unaligned buffers in connect's TYPBLK class
On MIPS platforms (and probably others) unaligned memory access results in a
bus error. In the connect storage engine, block data for some data formats is
stored packed in memory and the TYPBLK class is used to read values from it.
Since TYPBLK does not have special handling for this packed memory, it can
quite easily result in unaligned memory accesses.
.
The simple way to fix this is to perform all accesses to the main buffer
through memcpy. With GCC and optimizations turned on, this call to memcpy is
completely optimized away on architectures where unaligned accesses are ok
(like x86).
Author: James Cowgill <jcowgill@debian.org>
From: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Date: Thu, 10 Aug 2017 20:40:28 +0200
Subject: mips-connect-unaligned
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/storage/connect/valblk.h
+++ b/storage/connect/valblk.h
@@ -139,6 +139,7 @@ class VALBLK : public BLOCK {
int Prec; // Precision of float values
}; // end of class VALBLK
+
/***********************************************************************/
/* Class TYPBLK: represents a block of typed values. */
/***********************************************************************/
@@ -151,40 +152,41 @@ class TYPBLK : public VALBLK {
// Implementation
virtual bool Init(PGLOBAL g, bool check);
virtual int GetVlen(void) {return sizeof(TYPE);}
- virtual char GetTinyValue(int n) {return (char)Typp[n];}
- virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];}
- virtual short GetShortValue(int n) {return (short)Typp[n];}
- virtual ushort GetUShortValue(int n) {return (ushort)Typp[n];}
- virtual int GetIntValue(int n) {return (int)Typp[n];}
- virtual uint GetUIntValue(int n) {return (uint)Typp[n];}
- virtual longlong GetBigintValue(int n) {return (longlong)Typp[n];}
- virtual ulonglong GetUBigintValue(int n) {return (ulonglong)Typp[n];}
- virtual double GetFloatValue(int n) {return (double)Typp[n];}
+
+ virtual char GetTinyValue(int n) {return (char)UnalignedRead(n);}
+ virtual uchar GetUTinyValue(int n) {return (uchar)UnalignedRead(n);}
+ virtual short GetShortValue(int n) {return (short)UnalignedRead(n);}
+ virtual ushort GetUShortValue(int n) {return (ushort)UnalignedRead(n);}
+ virtual int GetIntValue(int n) {return (int)UnalignedRead(n);}
+ virtual uint GetUIntValue(int n) {return (uint)UnalignedRead(n);}
+ virtual longlong GetBigintValue(int n) {return (longlong)UnalignedRead(n);}
+ virtual ulonglong GetUBigintValue(int n) {return (ulonglong)UnalignedRead(n);}
+ virtual double GetFloatValue(int n) {return (double)UnalignedRead(n);}
virtual char *GetCharString(char *p, int n);
- virtual void Reset(int n) {Typp[n] = 0;}
+ virtual void Reset(int n) {UnalignedWrite(n, 0);}
// Methods
using VALBLK::SetValue;
virtual void SetValue(PCSZ sp, int n);
virtual void SetValue(const char *sp, uint len, int n);
virtual void SetValue(short sval, int n)
- {Typp[n] = (TYPE)sval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);}
virtual void SetValue(ushort sval, int n)
- {Typp[n] = (TYPE)sval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);}
virtual void SetValue(int lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(uint lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(longlong lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(ulonglong lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(double fval, int n)
- {Typp[n] = (TYPE)fval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)fval); SetNull(n, false);}
virtual void SetValue(char cval, int n)
- {Typp[n] = (TYPE)cval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);}
virtual void SetValue(uchar cval, int n)
- {Typp[n] = (TYPE)cval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);}
virtual void SetValue(PVAL valp, int n);
virtual void SetValue(PVBLK pv, int n1, int n2);
virtual void SetMin(PVAL valp, int n);
@@ -206,6 +208,17 @@ class TYPBLK : public VALBLK {
// Members
TYPE* const &Typp;
const char *Fmt;
+
+ // Unaligned access
+ TYPE UnalignedRead(int n) const {
+ TYPE result;
+ memcpy(&result, Typp + n, sizeof(TYPE));
+ return result;
+ }
+
+ void UnalignedWrite(int n, TYPE value) {
+ memcpy(Typp + n, &value, sizeof(TYPE));
+ }
}; // end of class TYPBLK
/***********************************************************************/
storage/connect/valblk.cpp | 41 ++++++++++++++++++-------------------
storage/connect/valblk.h | 51 +++++++++++++++++++++++++++++-----------------
2 files changed, 52 insertions(+), 40 deletions(-)
--- a/storage/connect/valblk.cpp
+++ b/storage/connect/valblk.cpp
@@ -266,14 +266,14 @@ bool TYPBLK<TYPE>::Init(PGLOBAL g, bool
@@ -268,14 +268,14 @@ bool TYPBLK<TYPE>::Init(PGLOBAL g, bool
template <class TYPE>
char *TYPBLK<TYPE>::GetCharString(char *p, int n)
{
@ -120,7 +26,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
return p;
} // end of GetCharString
@@ -289,7 +289,7 @@ void TYPBLK<TYPE>::SetValue(PVAL valp, i
@@ -291,7 +291,7 @@ void TYPBLK<TYPE>::SetValue(PVAL valp, i
ChkTyp(valp);
if (!(b = valp->IsNull()))
@ -129,7 +35,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
else
Reset(n);
@@ -351,9 +351,9 @@ void TYPBLK<TYPE>::SetValue(PCSZ p, int
@@ -353,9 +353,9 @@ void TYPBLK<TYPE>::SetValue(PCSZ p, int
ulonglong val = CharToNumber(p, strlen(p), maxval, Unsigned, &minus);
if (minus && val < maxval)
@ -141,7 +47,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
SetNull(n, false);
} // end of SetValue
@@ -396,7 +396,7 @@ void TYPBLK<double>::SetValue(PCSZ p, in
@@ -398,7 +398,7 @@ void TYPBLK<double>::SetValue(PCSZ p, in
throw Type;
} // endif Check
@ -150,7 +56,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
SetNull(n, false);
} // end of SetValue
@@ -428,7 +428,7 @@ void TYPBLK<TYPE>::SetValue(PVBLK pv, in
@@ -430,7 +430,7 @@ void TYPBLK<TYPE>::SetValue(PVBLK pv, in
ChkTyp(pv);
if (!(b = pv->IsNull(n2) && Nullable))
@ -159,7 +65,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
else
Reset(n1);
@@ -479,10 +479,10 @@ void TYPBLK<TYPE>::SetMin(PVAL valp, int
@@ -481,10 +481,10 @@ void TYPBLK<TYPE>::SetMin(PVAL valp, int
{
CheckParms(valp, n)
TYPE tval = GetTypedValue(valp);
@ -172,7 +78,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
} // end of SetMin
@@ -494,10 +494,10 @@ void TYPBLK<TYPE>::SetMax(PVAL valp, int
@@ -496,10 +496,10 @@ void TYPBLK<TYPE>::SetMax(PVAL valp, int
{
CheckParms(valp, n)
TYPE tval = GetTypedValue(valp);
@ -185,7 +91,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
} // end of SetMax
@@ -511,8 +511,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, i
@@ -513,8 +513,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, i
CheckType(pv)
TYPE *lp = ((TYPBLK*)pv)->Typp;
@ -195,7 +101,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
} // end of SetValues
#endif // 0
@@ -523,7 +522,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, i
@@ -525,7 +524,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, i
template <class TYPE>
void TYPBLK<TYPE>::Move(int i, int j)
{
@ -204,7 +110,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
MoveNull(i, j);
} // end of Move
@@ -537,7 +536,7 @@ int TYPBLK<TYPE>::CompVal(PVAL vp, int n
@@ -539,7 +538,7 @@ int TYPBLK<TYPE>::CompVal(PVAL vp, int n
ChkIndx(n);
ChkTyp(vp);
#endif // _DEBUG
@ -213,7 +119,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
TYPE vlv = GetTypedValue(vp);
return (vlv > mlv) ? 1 : (vlv < mlv) ? (-1) : 0;
@@ -549,8 +548,8 @@ int TYPBLK<TYPE>::CompVal(PVAL vp, int n
@@ -551,8 +550,8 @@ int TYPBLK<TYPE>::CompVal(PVAL vp, int n
template <class TYPE>
int TYPBLK<TYPE>::CompVal(int i1, int i2)
{
@ -224,7 +130,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
return (lv1 > lv2) ? 1 : (lv1 < lv2) ? (-1) : 0;
} // end of CompVal
@@ -587,7 +586,7 @@ int TYPBLK<TYPE>::Find(PVAL vp)
@@ -589,7 +588,7 @@ int TYPBLK<TYPE>::Find(PVAL vp)
TYPE n = GetTypedValue(vp);
for (i = 0; i < Nval; i++)
@ -233,7 +139,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
break;
return (i < Nval) ? i : (-1);
@@ -603,7 +602,7 @@ int TYPBLK<TYPE>::GetMaxLength(void)
@@ -605,7 +604,7 @@ int TYPBLK<TYPE>::GetMaxLength(void)
int i, n, m;
for (i = n = 0; i < Nval; i++) {
@ -242,7 +148,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
n = MY_MAX(n, m);
} // endfor i
@@ -1333,7 +1332,7 @@ char *DATBLK::GetCharString(char *p, int
@@ -1335,7 +1334,7 @@ char *DATBLK::GetCharString(char *p, int
char *vp;
if (Dvalp) {
@ -251,7 +157,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
vp = Dvalp->GetCharString(p);
} else
vp = TYPBLK<int>::GetCharString(p, n);
@@ -1349,7 +1348,7 @@ void DATBLK::SetValue(PCSZ p, int n)
@@ -1351,7 +1350,7 @@ void DATBLK::SetValue(PCSZ p, int n)
if (Dvalp) {
// Decode the string according to format
Dvalp->SetValue_psz(p);
@ -260,3 +166,92 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
} else
TYPBLK<int>::SetValue(p, n);
--- a/storage/connect/valblk.h
+++ b/storage/connect/valblk.h
@@ -139,6 +139,7 @@ class VALBLK : public BLOCK {
int Prec; // Precision of float values
}; // end of class VALBLK
+
/***********************************************************************/
/* Class TYPBLK: represents a block of typed values. */
/***********************************************************************/
@@ -151,40 +152,41 @@ class TYPBLK : public VALBLK {
// Implementation
virtual bool Init(PGLOBAL g, bool check);
virtual int GetVlen(void) {return sizeof(TYPE);}
- virtual char GetTinyValue(int n) {return (char)Typp[n];}
- virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];}
- virtual short GetShortValue(int n) {return (short)Typp[n];}
- virtual ushort GetUShortValue(int n) {return (ushort)Typp[n];}
- virtual int GetIntValue(int n) {return (int)Typp[n];}
- virtual uint GetUIntValue(int n) {return (uint)Typp[n];}
- virtual longlong GetBigintValue(int n) {return (longlong)Typp[n];}
- virtual ulonglong GetUBigintValue(int n) {return (ulonglong)Typp[n];}
- virtual double GetFloatValue(int n) {return (double)Typp[n];}
+
+ virtual char GetTinyValue(int n) {return (char)UnalignedRead(n);}
+ virtual uchar GetUTinyValue(int n) {return (uchar)UnalignedRead(n);}
+ virtual short GetShortValue(int n) {return (short)UnalignedRead(n);}
+ virtual ushort GetUShortValue(int n) {return (ushort)UnalignedRead(n);}
+ virtual int GetIntValue(int n) {return (int)UnalignedRead(n);}
+ virtual uint GetUIntValue(int n) {return (uint)UnalignedRead(n);}
+ virtual longlong GetBigintValue(int n) {return (longlong)UnalignedRead(n);}
+ virtual ulonglong GetUBigintValue(int n) {return (ulonglong)UnalignedRead(n);}
+ virtual double GetFloatValue(int n) {return (double)UnalignedRead(n);}
virtual char *GetCharString(char *p, int n);
- virtual void Reset(int n) {Typp[n] = 0;}
+ virtual void Reset(int n) {UnalignedWrite(n, 0);}
// Methods
using VALBLK::SetValue;
virtual void SetValue(PCSZ sp, int n);
virtual void SetValue(const char *sp, uint len, int n);
virtual void SetValue(short sval, int n)
- {Typp[n] = (TYPE)sval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);}
virtual void SetValue(ushort sval, int n)
- {Typp[n] = (TYPE)sval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);}
virtual void SetValue(int lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(uint lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(longlong lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(ulonglong lval, int n)
- {Typp[n] = (TYPE)lval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);}
virtual void SetValue(double fval, int n)
- {Typp[n] = (TYPE)fval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)fval); SetNull(n, false);}
virtual void SetValue(char cval, int n)
- {Typp[n] = (TYPE)cval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);}
virtual void SetValue(uchar cval, int n)
- {Typp[n] = (TYPE)cval; SetNull(n, false);}
+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);}
virtual void SetValue(PVAL valp, int n);
virtual void SetValue(PVBLK pv, int n1, int n2);
virtual void SetMin(PVAL valp, int n);
@@ -206,6 +208,17 @@ class TYPBLK : public VALBLK {
// Members
TYPE* const &Typp;
const char *Fmt;
+
+ // Unaligned access
+ TYPE UnalignedRead(int n) const {
+ TYPE result;
+ memcpy(&result, Typp + n, sizeof(TYPE));
+ return result;
+ }
+
+ void UnalignedWrite(int n, TYPE value) {
+ memcpy(Typp + n, &value, sizeof(TYPE));
+ }
}; // end of class TYPBLK
/***********************************************************************/

+ 9
- 13
utils/mariadb/patches/160-mips-machine.patch View File

@ -1,17 +1,13 @@
Description: Fix DEFAULT_MACHINE on mips
The DEFAULT_MACHINE constant is calculated from the CMAKE_SYSTEM_PROCESSOR
variable which contains the processor which built mariadb. Since most Debian
buildds run on 64-bit hardware even though they build 32-bit binaries,
DEFAULT_MACHINE previously contained "mips64" on 32-bit builds. This confuses
some mroonga tests which rely on DEFAULT_MACHINE to detect 64-bitness.
.
This patch fixes the value of DEFAULT_MACHINE so it always contains just "mips"
on 32-bit mips builds.
Author: James Cowgill <jcowgill@debian.org>
From: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Date: Thu, 10 Aug 2017 20:40:29 +0200
Subject: mips-machine
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- mariadb-10.1.orig/cmake/package_name.cmake
+++ mariadb-10.1/cmake/package_name.cmake
cmake/package_name.cmake | 4 ++++
1 file changed, 4 insertions(+)
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -34,6 +34,10 @@ IF(NOT VERSION)
SET(DEFAULT_MACHINE "mips")
ENDIF()


+ 40
- 74
utils/mariadb/patches/170-ppc-remove-glibc-dep.patch View File

@ -1,79 +1,45 @@
From f5cf70d9d1dc7f4cbeffb7fb75cbbe08720e3873 Mon Sep 17 00:00:00 2001
From: Gustavo Romero <gromero@br.ibm.com>
Date: Sun, 26 Mar 2017 15:08:15 +0000
Subject: [PATCH] Remove dependency on glibc on PPC
Remove dependency on glibc by using gcc builtin function and no glibc
wrappers.
Currently there are no surrogates in musl for:
__ppc_get_timebase()
__ppc_set_ppr_low()
__ppc_set_ppr_med()
however glibc __ppc_get_timebase() is just a wrapper for GCC builtin
__builtin_get_timebase() available since GCC 4.8 [1], so assuming that
aports on ppc64le will never be built using GCC < 4.8 we can just
switch directly to the GCC builtin function.
Also __ppc_set_ppr_{low,med}() are not available on musl but both
are simple glibc wrappers on a single asm instruction, hence there
is no harm in using asm directly instead. Actually, using asm
directly was the first solution adopted in MariaDB [2].
[1] https://goo.gl/jxLV6O
[2] https://goo.gl/9bjuVC
--- a/storage/xtradb/include/ut0ut.h
+++ b/storage/xtradb/include/ut0ut.h
@@ -83,9 +83,8 @@ private:
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
independent way by using YieldProcessor. */
# define UT_RELAX_CPU() YieldProcessor()
-# elif defined(__powerpc__) && defined __GLIBC__
-#include <sys/platform/ppc.h>
-# define UT_RELAX_CPU() __ppc_get_timebase()
+# elif defined(__powerpc__)
+# define UT_RELAX_CPU() __builtin_ppc_get_timebase()
# else
# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */
# endif
@@ -99,9 +98,8 @@ private:
#endif
--- a/include/my_cpu.h
+++ b/include/my_cpu.h
@@ -24,17 +24,16 @@
*/
# if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
#ifdef _ARCH_PWR8
-#include <sys/platform/ppc.h>
-# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low()
-# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med()
+# define UT_LOW_PRIORITY_CPU() __asm__ __volatile__ ("or 1,1,1")
+# define UT_RESUME_PRIORITY_CPU() __asm__ __volatile__ ("or 2,2,2")
# else
# define UT_LOW_PRIORITY_CPU() ((void)0)
# define UT_RESUME_PRIORITY_CPU() ((void)0)
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -68,9 +68,8 @@ Created 1/20/1994 Heikki Tuuri
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
independent way by using YieldProcessor. */
# define UT_RELAX_CPU() YieldProcessor()
-#elif defined(__powerpc__) && defined __GLIBC__
-# include <sys/platform/ppc.h>
-# define UT_RELAX_CPU() __ppc_get_timebase()
+#elif defined(__powerpc__)
+# define UT_RELAX_CPU() __builtin_ppc_get_timebase()
/* Very low priority */
-#define HMT_very_low() __ppc_set_ppr_very_low()
+#define HMT_very_low() asm volatile("or 31,31,31")
/* Low priority */
-#define HMT_low() __ppc_set_ppr_low()
+#define HMT_low() asm volatile ("or 1,1,1")
/* Medium low priority */
-#define HMT_medium_low() __ppc_set_ppr_med_low()
+#define HMT_medium_low() asm volatile ("or 6,6,6")
/* Medium priority */
-#define HMT_medium() __ppc_set_ppr_med()
+#define HMT_medium() asm volatile ("or 2,2,2")
/* Medium high priority */
-#define HMT_medium_high() __ppc_set_ppr_med_high()
+#define HMT_medium_high() asm volatile("or 5,5,5")
/* High priority */
#define HMT_high() asm volatile("or 3,3,3")
#else
# define UT_RELAX_CPU() do { \
volatile int32 volatile_var; \
@@ -88,9 +87,8 @@ Created 1/20/1994 Heikki Tuuri
@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void)
__asm__ __volatile__ ("pause");
#endif
#if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
-# include <sys/platform/ppc.h>
-# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low()
-# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med()
+# define UT_LOW_PRIORITY_CPU() __asm__ __volatile__ ("or 1,1,1")
+# define UT_RESUME_PRIORITY_CPU() __asm__ __volatile__ ("or 2,2,2")
#elif defined(_ARCH_PWR8)
- __ppc_get_timebase();
+ __builtin_ppc_get_timebase();
#else
# define UT_LOW_PRIORITY_CPU() ((void)0)
# define UT_RESUME_PRIORITY_CPU() ((void)0)
int32 var, oldval = 0;
my_atomic_cas32_strong_explicit(&var, &oldval, 1, MY_MEMORY_ORDER_RELAXED,
--- a/storage/tokudb/PerconaFT/portability/toku_time.h
+++ b/storage/tokudb/PerconaFT/portability/toku_time.h
@@ -124,7 +124,7 @@ static inline tokutime_t toku_time_now(v
__asm __volatile__ ("mrs %[rt], cntvct_el0" : [rt] "=r" (result));
return result;
#elif defined(__powerpc__)
- return __ppc_get_timebase();
+ return __builtin_ppc_get_timebase();
#else
#error No timer implementation for this platform
#endif

+ 0
- 105
utils/mariadb/patches/180-libedit.patch View File

@ -1,105 +0,0 @@
commit 2220f7458ef90829eacc457167a28aeba75ca1bc
Author: Sebastian Kemper <sebastian_ml@gmx.net>
Date: Sun Dec 9 21:19:24 2018 +0100
cmake: support new libedit interface
libedit changed it's interface a while ago. MariaDB's cmake file doesn't
recognize the new interface, the compile test fails:
/mariadb-10.2.19/CMakeFiles/CMakeTmp/src.cxx: In function 'int main(int, char**)':
/mariadb-10.2.19/CMakeFiles/CMakeTmp/src.cxx:6:47: error: invalid conversion from 'char*' to 'int' [-fpermissive]
int res= (*rl_completion_entry_function)(0,0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Fix this by adding a detection for the new interface as well.
In client/mysql.cc the ifdefs for the new readline interface are
extended to also check for the new libedit interface. They work the same
way.
Run-tested on a MIPS machine.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2578,7 +2578,7 @@ C_MODE_END
if not.
*/
-#if defined(USE_NEW_READLINE_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_NEW_LIBEDIT_INTERFACE)
static int fake_magic_space(int, int);
extern "C" char *no_completion(const char*,int)
#elif defined(USE_LIBEDIT_INTERFACE)
@@ -2660,7 +2660,7 @@ static int not_in_history(const char *li
}
-#if defined(USE_NEW_READLINE_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_NEW_LIBEDIT_INTERFACE)
static int fake_magic_space(int, int)
#else
static int fake_magic_space(const char *, int)
@@ -2677,7 +2677,7 @@ static void initialize_readline (char *n
rl_readline_name = name;
/* Tell the completer that we want a crack first. */
-#if defined(USE_NEW_READLINE_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_NEW_LIBEDIT_INTERFACE)
rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;
rl_completion_entry_function= (rl_compentry_func_t*)&no_completion;
@@ -2707,7 +2707,7 @@ static char **new_mysql_completion(const
int end __attribute__((unused)))
{
if (!status.batch && !quick)
-#if defined(USE_NEW_READLINE_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_NEW_LIBEDIT_INTERFACE)
return rl_completion_matches(text, new_command_generator);
#else
return completion_matches((char *)text, (CPFunction *)new_command_generator);
--- a/cmake/readline.cmake
+++ b/cmake/readline.cmake
@@ -160,8 +160,20 @@ MACRO (MYSQL_FIND_SYSTEM_LIBEDIT)
int res= (*rl_completion_entry_function)(0,0);
completion_matches(0,0);
}"
- LIBEDIT_INTERFACE)
- SET(USE_LIBEDIT_INTERFACE ${LIBEDIT_INTERFACE})
+ LIBEDIT_HAVE_COMPLETION_INT)
+
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <stdio.h>
+ #include <readline.h>
+ int main(int argc, char **argv)
+ {
+ char res= *(*rl_completion_entry_function)(0,0);
+ completion_matches(0,0);
+ }"
+ LIBEDIT_HAVE_COMPLETION_CHAR)
+ IF(LIBEDIT_HAVE_COMPLETION_INT OR LIBEDIT_HAVE_COMPLETION_CHAR)
+ SET(USE_LIBEDIT_INTERFACE 1)
+ ENDIF()
ENDIF()
ENDMACRO()
@@ -187,6 +199,7 @@ MACRO (MYSQL_CHECK_READLINE)
IF(USE_LIBEDIT_INTERFACE)
SET(MY_READLINE_INCLUDE_DIR ${LIBEDIT_INCLUDE_DIR})
SET(MY_READLINE_LIBRARY ${LIBEDIT_LIBRARY} ${CURSES_LIBRARY})
+ SET(USE_NEW_LIBEDIT_INTERFACE ${LIBEDIT_HAVE_COMPLETION_CHAR})
ELSE()
MYSQL_USE_BUNDLED_READLINE()
ENDIF()
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -113,6 +113,7 @@
/* Readline */
#cmakedefine HAVE_HIST_ENTRY 1
#cmakedefine USE_LIBEDIT_INTERFACE 1
+#cmakedefine USE_NEW_LIBEDIT_INTERFACE 1
#cmakedefine USE_NEW_READLINE_INTERFACE 1
#cmakedefine FIONREAD_IN_SYS_IOCTL 1

+ 39
- 0
utils/mariadb/patches/180-relax-mysql_install-db-wrt-pam-tool.patch View File

@ -0,0 +1,39 @@
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -359,6 +359,14 @@ then
exit 1
fi
plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin`
+ # Upstream assumes all plugins will be always installed, but in OpenWrt we can
+ # install a server without plugins if we want to.
+ if test -z "$plugindir"
+ then
+ echo "Could not find plugin directory." >&2
+ echo "Will continue with \"/usr/lib/mariadb/plugin\"." >&2
+ plugindir=/usr/lib/mariadb/plugin
+ fi
pamtooldir=$plugindir
# relative from where the script was run for a relocatable install
elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mysqld"
@@ -478,7 +486,9 @@ do
fi
done
-if test -n "$user"
+# There should be no need for this on OpenWrt. If this turns out to be a wrong guess then
+# we can revisit.
+if test -n ""
then
chown $user "$pamtooldir/auth_pam_tool_dir" && \
chmod 0700 "$pamtooldir/auth_pam_tool_dir"
@@ -499,6 +509,10 @@ then
echo
fi
fi
+fi
+
+if test -n "$user"
+then
args="$args --user=$user"
fi

Loading…
Cancel
Save