Skip to content

Commit

Permalink
Merge 11.0 into 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 19, 2023
2 parents 05d850d + be24e75 commit 9b2a65e
Show file tree
Hide file tree
Showing 503 changed files with 14,941 additions and 28,852 deletions.
6 changes: 4 additions & 2 deletions BUILD/SETUP.sh
Expand Up @@ -126,8 +126,10 @@ get_make_parallel_flag
# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. --with-ssl=yes will first try system library
# then the bundled one --with-ssl=system will use the system library.
# We use bundled by default as this is guaranteed to work with Galera
SSL_LIBRARY=--with-ssl=bundled
# We normally use bundled by default as this is guaranteed to work with Galera
# However as bundled gives problem on SuSE with tls_version1.test, system
# is used
SSL_LIBRARY=--with-ssl=system

if [ "x$warning_mode" = "xpedantic" ]; then
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Expand Up @@ -195,6 +195,15 @@ ENDIF()

OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)

#
# Enable protection of statement's memory root after first SP/PS execution.
# Can be switched on only for debug build.
#
OPTION(WITH_PROTECT_STATEMENT_MEMROOT "Enable protection of statement's memory root after first SP/PS execution. Turned into account only for debug build" OFF)
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND WITH_PROTECT_STATEMENT_MEMROOT)
ADD_DEFINITIONS(-DPROTECT_STATEMENT_MEMROOT)
ENDIF()

INCLUDE(check_compiler_flag)
INCLUDE(check_linker_flag)

Expand Down
2 changes: 1 addition & 1 deletion client/mysqlbinlog.cc
Expand Up @@ -1639,7 +1639,7 @@ static struct my_option my_options[] =
"given sequence numbers are printed.",
&stop_pos_str, &stop_pos_str, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"table", 'T', "List entries for just this table (local log only).",
{"table", 'T', "List entries for just this table (affects only row events).",
&table, &table, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
Expand Down
40 changes: 29 additions & 11 deletions client/mysqltest.cc
Expand Up @@ -1037,35 +1037,38 @@ static int do_read_query_result(struct st_connection *cn)
static int do_stmt_prepare(struct st_connection *cn, const char *q, int q_len)
{
/* The cn->stmt is already set. */
DBUG_ENTER("do_stmt_prepare");
if (!cn->has_thread)
return mysql_stmt_prepare(cn->stmt, q, q_len);
DBUG_RETURN(mysql_stmt_prepare(cn->stmt, q, q_len));
cn->cur_query= q;
cn->cur_query_len= q_len;
signal_connection_thd(cn, EMB_PREPARE_STMT);
wait_query_thread_done(cn);
return cn->result;
DBUG_RETURN(cn->result);
}


static int do_stmt_execute(struct st_connection *cn)
{
DBUG_ENTER("do_stmt_execute");
/* The cn->stmt is already set. */
if (!cn->has_thread)
return mysql_stmt_execute(cn->stmt);
DBUG_RETURN(mysql_stmt_execute(cn->stmt));
signal_connection_thd(cn, EMB_EXECUTE_STMT);
wait_query_thread_done(cn);
return cn->result;
DBUG_RETURN(cn->result);
}


static int do_stmt_close(struct st_connection *cn)
{
DBUG_ENTER("do_stmt_close");
/* The cn->stmt is already set. */
if (!cn->has_thread)
return mysql_stmt_close(cn->stmt);
DBUG_RETURN(mysql_stmt_close(cn->stmt));
signal_connection_thd(cn, EMB_CLOSE_STMT);
wait_query_thread_done(cn);
return cn->result;
DBUG_RETURN(cn->result);
}


Expand Down Expand Up @@ -7967,6 +7970,7 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql)

if (!(count= mysql_warning_count(mysql)))
DBUG_RETURN(0);
DBUG_PRINT("info", ("Warnings: %ud", count));

/*
If one day we will support execution of multi-statements
Expand Down Expand Up @@ -8422,13 +8426,17 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
char *query, size_t query_len, DYNAMIC_STRING *ds,
DYNAMIC_STRING *ds_warnings)
{
my_bool ignore_second_execution= 0;
MYSQL_RES *res= NULL; /* Note that here 'res' is meta data result set */
MYSQL *mysql= cn->mysql;
MYSQL_STMT *stmt;
DYNAMIC_STRING ds_prepare_warnings;
DYNAMIC_STRING ds_execute_warnings;
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));
DBUG_PRINT("info",
("disable_warnings: %d prepare_warnings_enabled: %d",
(int) disable_warnings, (int) prepare_warnings_enabled));

if (!mysql)
{
Expand Down Expand Up @@ -8499,12 +8507,18 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
mysql_stmt_error(stmt), mysql_stmt_sqlstate(stmt), ds);
goto end;
}
/*
We cannot run query twice if we get prepare warnings as these will otherwise be
disabled
*/
ignore_second_execution= (prepare_warnings_enabled &&
mysql_warning_count(mysql) != 0);
}

/*
Execute the query
*/
if (do_stmt_execute(cn))
if (!ignore_second_execution && do_stmt_execute(cn))
{
handle_error(command, mysql_stmt_errno(stmt),
mysql_stmt_error(stmt), mysql_stmt_sqlstate(stmt), ds);
Expand Down Expand Up @@ -8579,7 +8593,10 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
that warnings from both the prepare and execute phase are shown.
*/
if (!disable_warnings && !prepare_warnings_enabled)
{
DBUG_PRINT("info", ("warnings disabled"));
dynstr_set(&ds_prepare_warnings, NULL);
}
}
else
{
Expand Down Expand Up @@ -8682,7 +8699,9 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
error - function will not return
*/

void run_prepare_stmt(struct st_connection *cn, struct st_command *command, const char *query, size_t query_len, DYNAMIC_STRING *ds, DYNAMIC_STRING *ds_warnings)
void run_prepare_stmt(struct st_connection *cn, struct st_command *command,
const char *query, size_t query_len, DYNAMIC_STRING *ds,
DYNAMIC_STRING *ds_warnings)
{

MYSQL *mysql= cn->mysql;
Expand Down Expand Up @@ -8843,9 +8862,8 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
*/

void run_execute_stmt(struct st_connection *cn, struct st_command *command,
const char *query, size_t query_len, DYNAMIC_STRING *ds,
DYNAMIC_STRING *ds_warnings
)
const char *query, size_t query_len, DYNAMIC_STRING *ds,
DYNAMIC_STRING *ds_warnings)
{
MYSQL_RES *res= NULL; /* Note that here 'res' is meta data result set */
MYSQL *mysql= cn->mysql;
Expand Down
33 changes: 0 additions & 33 deletions cmake/stack_direction.c

This file was deleted.

24 changes: 5 additions & 19 deletions configure.cmake
Expand Up @@ -672,25 +672,11 @@ int main()
}
" HAVE_PTHREAD_YIELD_ZERO_ARG)

IF(NOT STACK_DIRECTION)
IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
MESSAGE(FATAL_ERROR
"STACK_DIRECTION is not defined. Please specify -DSTACK_DIRECTION=1 "
"or -DSTACK_DIRECTION=-1 when calling cmake.")
ELSE()
TRY_RUN(STACKDIR_RUN_RESULT STACKDIR_COMPILE_RESULT
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/cmake/stack_direction.c
)
# Test program returns 0 (down) or 1 (up).
# Convert to -1 or 1
IF(STACKDIR_RUN_RESULT EQUAL 0)
SET(STACK_DIRECTION -1 CACHE INTERNAL "Stack grows direction")
ELSE()
SET(STACK_DIRECTION 1 CACHE INTERNAL "Stack grows direction")
ENDIF()
MESSAGE(STATUS "Checking stack direction : ${STACK_DIRECTION}")
ENDIF()
IF(STACK_DIRECTION)
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
SET(STACK_DIRECTION 1 CACHE INTERNAL "Stack grows direction")
ELSE()
SET(STACK_DIRECTION -1 CACHE INTERNAL "Stack grows direction")
ENDIF()

#
Expand Down
10 changes: 0 additions & 10 deletions debian/rules
Expand Up @@ -51,16 +51,6 @@ ifeq (32,$(DEB_HOST_ARCH_BITS))
CMAKEFLAGS += -DPLUGIN_ROCKSDB=NO
endif

# Cross building requires stack direction instruction
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),alpha amd64 arm arm64 i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64))
CMAKEFLAGS += -DSTACK_DIRECTION=-1
endif
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),hppa))
CMAKEFLAGS += -DSTACK_DIRECTION=1
endif
endif

# Only attempt to build with PMEM on archs that have package libpmem-dev available
# See https://packages.debian.org/search?searchon=names&keywords=libpmem-dev
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el riscv64))
Expand Down
16 changes: 13 additions & 3 deletions extra/mariabackup/xtrabackup.cc
Expand Up @@ -80,6 +80,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <srv0start.h>
#include "trx0sys.h"
#include <buf0dblwr.h>
#include <buf0flu.h>
#include "ha_innodb.h"

#include <list>
Expand Down Expand Up @@ -2385,10 +2386,15 @@ static bool innodb_init()
buf_flush_sync();
recv_sys.debug_free();
ut_ad(!os_aio_pending_reads());
ut_ad(!os_aio_pending_writes());
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
ut_ad(!buf_pool.get_oldest_modification(0));
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
/* os_aio_pending_writes() may hold here if some write_io_callback()
did not release the slot yet. However, the page write itself must
have completed, because the buf_pool.flush_list is empty. In debug
builds, we wait for this to happen, hoping to get a hung process if
this assumption does not hold. */
ut_d(os_aio_wait_until_no_pending_writes(false));
log_sys.close_file();

if (xtrabackup_incremental)
Expand Down Expand Up @@ -4693,7 +4699,9 @@ static bool xtrabackup_backup_func()
goto fail;
}

log_sys.create();
if (!log_sys.create()) {
goto fail;
}
/* get current checkpoint_lsn */
{
mysql_mutex_lock(&recv_sys.mutex);
Expand Down Expand Up @@ -6057,7 +6065,9 @@ static bool xtrabackup_prepare_func(char** argv)
}

recv_sys.create();
log_sys.create();
if (!log_sys.create()) {
goto error;
}
recv_sys.recovery_on = true;

xb_fil_io_init();
Expand Down
5 changes: 5 additions & 0 deletions extra/wolfssl/CMakeLists.txt
Expand Up @@ -102,6 +102,9 @@ ${WOLFCRYPT_SRCDIR}/rsa.c
${WOLFCRYPT_SRCDIR}/sha.c
${WOLFCRYPT_SRCDIR}/sha256.c
${WOLFCRYPT_SRCDIR}/sha512.c
${WOLFCRYPT_SRCDIR}/poly1305.c
${WOLFCRYPT_SRCDIR}/chacha.c
${WOLFCRYPT_SRCDIR}/chacha20_poly1305.c
${WOLFCRYPT_SRCDIR}/wc_port.c
${WOLFCRYPT_SRCDIR}/wc_encrypt.c
${WOLFCRYPT_SRCDIR}/hash.c
Expand Down Expand Up @@ -159,6 +162,8 @@ IF(WOLFSSL_X86_64_BUILD)
LIST(APPEND WOLFCRYPT_SOURCES
${WOLFCRYPT_SRCDIR}/aes_asm.S
${WOLFCRYPT_SRCDIR}/aes_gcm_asm.S
${WOLFCRYPT_SRCDIR}/chacha_asm.S
${WOLFCRYPT_SRCDIR}/poly1305_asm.S
${WOLFCRYPT_SRCDIR}/sha512_asm.S
${WOLFCRYPT_SRCDIR}/sha256_asm.S)
ADD_DEFINITIONS(-maes -msse4.2 -mpclmul)
Expand Down
4 changes: 4 additions & 0 deletions extra/wolfssl/user_settings.h.in
Expand Up @@ -19,11 +19,15 @@
#define HAVE_TLS_EXTENSIONS
#define HAVE_AES_ECB
#define HAVE_AESGCM
#define HAVE_CHACHA
#define HAVE_POLY1305
#define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB
#define OPENSSL_ALL
#define WOLFSSL_ALLOW_TLSV10
#define NO_OLD_TIMEVAL_NAME
#define HAVE_SECURE_RENEGOTIATION
#define HAVE_EXTENDED_MASTER

/* TLSv1.3 definitions (all needed to build) */
#define WOLFSSL_TLS13
Expand Down
6 changes: 6 additions & 0 deletions include/m_ctype.h
Expand Up @@ -1020,6 +1020,12 @@ struct charset_info_st
return (coll->strnncollsp)(this, (uchar *) a, alen, (uchar *) b, blen);
}

int strnncollsp(const LEX_CSTRING &a, const LEX_CSTRING &b) const
{
return (coll->strnncollsp)(this, (uchar *) a.str, a.length,
(uchar *) b.str, b.length);
}

size_t strnxfrm(char *dst, size_t dstlen, uint nweights,
const char *src, size_t srclen, uint flags) const
{
Expand Down
4 changes: 4 additions & 0 deletions include/my_alloc.h
Expand Up @@ -53,6 +53,10 @@ typedef struct st_mem_root
unsigned short first_block_usage;
unsigned short flags;

#ifdef PROTECT_STATEMENT_MEMROOT
int read_only;
#endif

void (*error_handler)(void);

PSI_memory_key psi_key;
Expand Down
4 changes: 4 additions & 0 deletions include/my_sys.h
Expand Up @@ -161,6 +161,7 @@ extern my_thread_id (*sf_malloc_dbug_id)(void);

typedef void (*MALLOC_SIZE_CB) (long long size, my_bool is_thread_specific);
extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
extern MALLOC_SIZE_CB update_malloc_size;

/* defines when allocating data */
extern void *my_malloc(PSI_memory_key key, size_t size, myf MyFlags);
Expand Down Expand Up @@ -898,6 +899,8 @@ extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
size_t prealloc_size);
extern USED_MEM *get_last_memroot_block(MEM_ROOT* root);
extern void free_all_new_blocks(MEM_ROOT *root, USED_MEM *last_block);
extern void protect_root(MEM_ROOT *root, int prot);
extern char *strdup_root(MEM_ROOT *root,const char *str);
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
Expand All @@ -906,6 +909,7 @@ static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
}
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);

extern LEX_CSTRING safe_lexcstrdup_root(MEM_ROOT *root, const LEX_CSTRING str);
extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
Expand Down
1 change: 0 additions & 1 deletion include/mysql.h
Expand Up @@ -141,7 +141,6 @@ typedef unsigned long long my_ulonglong;
#define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN
#define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
#define ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT ER_QUERY_RESULT_INCOMPLETE
#define ER_KEY_COLUMN_DOES_NOT_EXITS ER_KEY_COLUMN_DOES_NOT_EXIST
#define ER_DROP_PARTITION_NON_EXISTENT ER_PARTITION_DOES_NOT_EXIST

Expand Down
2 changes: 1 addition & 1 deletion include/mysql/service_my_crypt.h
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 672
#define MY_AES_CTX_SIZE 1040

enum my_aes_mode {
MY_AES_ECB, MY_AES_CBC
Expand Down

0 comments on commit 9b2a65e

Please sign in to comment.