Skip to content

Commit

Permalink
Merge mariadb-10.5.3 into 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed May 12, 2020
2 parents 9810e0a + 173adea commit 0186b0a
Show file tree
Hide file tree
Showing 100 changed files with 1,570 additions and 288 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
ENDIF()

INCLUDE(wsrep)
INCLUDE(cpack_rpm)
INCLUDE(cpack_deb)

OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_EXIT()" ON)
IF(WITH_DBUG_TRACE)
Expand Down Expand Up @@ -383,8 +381,6 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE()

SET(MALLOC_LIBRARY "system")
SET(PYTHON_SHEBANG "/usr/bin/env python" CACHE STRING "python shebang")
MARK_AS_ADVANCED(PYTHON_SHEBANG)

CHECK_PCRE()

Expand Down Expand Up @@ -421,6 +417,12 @@ UNSET (MYSQLD_STATIC_PLUGIN_LIBS CACHE)

INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)

INCLUDE(cpack_rpm)
INCLUDE(cpack_deb)

SET(PYTHON_SHEBANG "/usr/bin/env python" CACHE STRING "python shebang")
MARK_AS_ADVANCED(PYTHON_SHEBANG)

# Add storage engines and plugins.
CONFIGURE_PLUGINS()

Expand Down
36 changes: 32 additions & 4 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,16 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/sysusers.d"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig"
"%ignore ${CMAKE_INSTALL_PREFIX}/sbin"
"%ignore ${CMAKE_INSTALL_PREFIX}/share"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/doc"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
Expand Down Expand Up @@ -192,9 +196,10 @@ SET(CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/
SET(CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)

MACRO(ALTERNATIVE_NAME real alt)
SET(ver "%{version}-%{release}")
IF (${epoch})
SET(ver "${epoch}:${ver}")
IF(${ARGC} GREATER 2)
SET(ver ${ARGV2})
ELSE()
SET(ver "${epoch}%{version}-%{release}")
ENDIF()

SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
Expand All @@ -209,17 +214,40 @@ ALTERNATIVE_NAME("test" "mysql-test")

# Argh! Different distributions call packages differently, to be a drop-in
# replacement we have to fake distribution-specific dependencies
# NOTE, use ALTERNATIVE_NAME when a package has a different name
# in some distribution, it's not for adding new PROVIDES

IF(RPM MATCHES "(rhel|centos)6")
ALTERNATIVE_NAME("client" "mysql")
ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
SET(epoch 1) # this is fedora
SET(epoch 1:) # this is fedora
ALTERNATIVE_NAME("client" "mariadb")
ALTERNATIVE_NAME("client" "mysql")
ALTERNATIVE_NAME("devel" "mariadb-devel")
ALTERNATIVE_NAME("server" "mariadb-server")
ALTERNATIVE_NAME("server" "mysql-compat-server")
ALTERNATIVE_NAME("test" "mariadb-test")
ELSEIF(RPM MATCHES "(rhel|centos)8")
SET(epoch 3:)
ALTERNATIVE_NAME("backup" "mariadb-backup")
ALTERNATIVE_NAME("client" "mariadb")
ALTERNATIVE_NAME("common" "mariadb-common")
ALTERNATIVE_NAME("common" "mariadb-errmsg")
ALTERNATIVE_NAME("server" "mariadb-server")
ALTERNATIVE_NAME("server" "mariadb-server-utils")
ALTERNATIVE_NAME("shared" "mariadb-connector-c" ${MARIADB_CONNECTOR_C_VERSION}-1)
ALTERNATIVE_NAME("shared" "mariadb-connector-c-config" ${MARIADB_CONNECTOR_C_VERSION}-1)
SETA(CPACK_RPM_client_PACKAGE_PROVIDES "mariadb-galera = 3:%{version}-%{release}")
SETA(CPACK_RPM_common_PACKAGE_PROVIDES "mariadb-galera-common = 3:%{version}-%{release}")
SETA(CPACK_RPM_common_PACKAGE_REQUIRES "MariaDB-shared")
ELSEIF(RPM MATCHES "sles")
ALTERNATIVE_NAME("server" "mariadb")
SETA(CPACK_RPM_server_PACKAGE_PROVIDES
"mysql = %{version}-%{release}"
"mariadb_${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}"
"mariadb-${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}"
"mariadb-server = %{version}-%{release}"
)
ENDIF()
IF(RPM MATCHES "fedora31" OR RPM MATCHES "(rhel|centos)8")
SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang")
Expand Down
3 changes: 3 additions & 0 deletions cmake/mariadb_connector_c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ IF(UNIX)
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})"
COMPONENT Development)
ENDIF()

GET_DIRECTORY_PROPERTY(MARIADB_CONNECTOR_C_VERSION DIRECTORY libmariadb DEFINITION CPACK_PACKAGE_VERSION)
MESSAGE1(MARIADB_CONNECTOR_C_VERSION "MariaDB Connector/C ${MARIADB_CONNECTOR_C_VERSION}")
9 changes: 7 additions & 2 deletions extra/wolfssl/user_settings.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
#define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB
#define OPENSSL_ALL
#define WOLFSSL_ALLOW_TLSV10
#undef WOLFSSL_ALLOW_TLSV10 /* see https://github.com/wolfSSL/wolfssl/issues/2960 */
#define NO_OLD_TIMEVAL_NAME
/*
FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test
WolfSSL will use more stack space with it, with fastmath
*/
#define FP_MAX_BITS 16384

#cmakedefine WOLFSSL_AESNI
#cmakedefine USE_FAST_MATH
#cmakedefine TFM_TIMING_RESISTANT
#cmakedefine HAVE_INTEL_RDSEED
#cmakedefine USE_INTEL_SPEEDUP
#cmakedefine FP_MAX_BITS @FP_MAX_BITS@
#cmakedefine USE_FAST_MATH
#cmakedefine WOLFSSL_X86_64_BUILD

Expand Down
2 changes: 1 addition & 1 deletion extra/wolfssl/wolfssl
Submodule wolfssl updated 784 files
49 changes: 25 additions & 24 deletions include/my_compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,31 +128,32 @@ extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a);
#endif

/**
Return values of index_cond_func_xxx functions.
0=ICP_NO_MATCH - index tuple doesn't satisfy the pushed index condition (the
engine should discard the tuple and go to the next one)
1=ICP_MATCH - index tuple satisfies the pushed index condition (the
engine should fetch and return the record)
2=ICP_OUT_OF_RANGE - index tuple is out range that we're scanning, e.g. this
if we're scanning "t.key BETWEEN 10 AND 20" and got a
"t.key=21" tuple (the engine should stop scanning and
return HA_ERR_END_OF_FILE right away).
3=ICP_ABORTED_BY_USER - engine must stop scanning and should return
HA_ERR_ABORTED_BY_USER right away
-1= ICP_ERROR - Reserved for internal errors in engines. Should not be
returned by index_cond_func_xxx
Return values for pushed index condition or rowid filter check functions.
0=CHECK_NEG - The filter is not satisfied. The engine should discard this
index tuple and continue the scan.
1=CHECK_POS - The filter is statisfied. Current index tuple should be
returned to the SQL layer.
2=CHECK_OUT_OF_RANGE - the index tuple is outside of the range that we're
scanning. (Example: if we're scanning "t.key BETWEEN 10 AND
20" and got a "t.key=21" tuple) Tthe engine should stop
scanning and return HA_ERR_END_OF_FILE right away).
3=CHECK_ABORTED_BY_USER - the engine must stop scanning and should return
HA_ERR_ABORTED_BY_USER right away
-1=CHECK_ERROR - Reserved for internal errors in engines. Should not be
returned by ICP or rowid filter check functions.
*/

typedef enum icp_result {
ICP_ERROR=-1,
ICP_NO_MATCH=0,
ICP_MATCH=1,
ICP_OUT_OF_RANGE=2,
ICP_ABORTED_BY_USER=3
} ICP_RESULT;

typedef ICP_RESULT (*index_cond_func_t)(void *param);
typedef int (*rowid_filter_func_t)(void *param);
typedef enum check_result {
CHECK_ERROR=-1,
CHECK_NEG=0,
CHECK_POS=1,
CHECK_OUT_OF_RANGE=2,
CHECK_ABORTED_BY_USER=3
} check_result_t;

typedef check_result_t (*index_cond_func_t)(void *param);
typedef check_result_t (*rowid_filter_func_t)(void *param);
typedef int (*rowid_filter_is_active_func_t)(void *param);

#endif /* _my_compare_h */
2 changes: 1 addition & 1 deletion include/mysql/service_my_crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32

#define MY_AES_CTX_SIZE 600
#define MY_AES_CTX_SIZE 640

enum my_aes_mode {
MY_AES_ECB, MY_AES_CBC
Expand Down
2 changes: 1 addition & 1 deletion include/ssl_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@

#ifndef HAVE_WOLFSSL
#define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X)
#endif
#define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X)
#endif
#define X509_get0_notBefore(X) X509_get_notBefore(X)
#define X509_get0_notAfter(X) X509_get_notAfter(X)
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/violite.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ int vio_getnameinfo(const struct sockaddr *sa,
/* Set yaSSL to use same type as MySQL do for socket handles */
typedef my_socket YASSL_SOCKET_T;
#define YASSL_SOCKET_T_DEFINED
#define Timeval WOLFSSL_Timeval
#define template _template /* bug in WolfSSL 4.4.0, see also my_crypt.cc */
#include <openssl/ssl.h>
#undef Timeval
#undef template
#include <openssl/err.h>
#ifdef DEPRECATED
#undef DEPRECATED
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
2 changes: 1 addition & 1 deletion mysql-test/main/explain_non_select.result
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ INSERT INTO t1 VALUES (1),(2);
EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE global_priv index NULL PRIMARY 420 NULL 4 Using index
1 SIMPLE global_priv index NULL PRIMARY 420 NULL 5 Using index
DROP TABLE t1;
DROP VIEW v1;
#
Expand Down
16 changes: 8 additions & 8 deletions mysql-test/main/failed_auth_3909.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ create user baz identified via mysql_old_password;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u1;
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2;
ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2,password;
ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
connect(localhost,uu2,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,uu2;
ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format
connect(localhost,uu2,password,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,uu2,password;
ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format
delete from mysql.user where plugin = 'mysql_old_password';
flush privileges;
8 changes: 4 additions & 4 deletions mysql-test/main/failed_auth_3909.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ connect (fail,localhost,u1);

--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (fail,localhost,u2);
connect (fail,localhost,uu2);

--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (fail,localhost,u2,password);
connect (fail,localhost,uu2,password);

--error ER_ACCESS_DENIED_ERROR
change_user u1;

--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
change_user u2;
change_user uu2;

--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
change_user u2,password;
change_user uu2,password;

delete from mysql.user where plugin = 'mysql_old_password';
flush privileges;
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/failed_auth_unixsocket.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket');
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root';
flush privileges;
connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'USER'@'localhost'
ERROR 28000: Access denied for user 'USER'@'localhost'
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin'));
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root';
flush privileges;
4 changes: 2 additions & 2 deletions mysql-test/main/failed_auth_unixsocket.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# MDEV-3909 remote user enumeration
# unix_socket tests
#
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket');
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root';
flush privileges;

# Make sure that the replace works, even if $USER is 'user' or something else
Expand All @@ -22,5 +22,5 @@ connect (fail,localhost,$USER);
--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
change_user $USER;

update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin'));
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root';
flush privileges;
4 changes: 2 additions & 2 deletions mysql-test/main/gis_notembedded.result
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
show create procedure mysql.AddGeometryColumn;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
AddGeometryColumn CREATE DEFINER=`root`@`localhost` PROCEDURE `AddGeometryColumn`(catalog varchar(64), t_schema varchar(64),
AddGeometryColumn CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE `AddGeometryColumn`(catalog varchar(64), t_schema varchar(64),
t_name varchar(64), geometry_column varchar(64), t_srid int)
SQL SECURITY INVOKER
begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure mysql.DropGeometryColumn;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
DropGeometryColumn CREATE DEFINER=`root`@`localhost` PROCEDURE `DropGeometryColumn`(catalog varchar(64), t_schema varchar(64),
DropGeometryColumn CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE `DropGeometryColumn`(catalog varchar(64), t_schema varchar(64),
t_name varchar(64), geometry_column varchar(64))
SQL SECURITY INVOKER
begin
Expand Down
Loading

0 comments on commit 0186b0a

Please sign in to comment.