Skip to content

Commit

Permalink
Merge branch '10.3' into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Jul 27, 2022
2 parents 9a89733 + bd935a4 commit 3bb36e9
Show file tree
Hide file tree
Showing 267 changed files with 17,500 additions and 7,356 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ test_script:
- set PATH=C:\Strawberry\perl\bin;%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
- cd %APPVEYOR_BUILD_FOLDER%\_build\mysql-test
- set /A parallel=4*%NUMBER_OF_PROCESSORS%
- perl mysql-test-run.pl --force --max-test-fail=10 --retry=2 -parallel=%parallel% --testcase-timeout=4 --suite=main --skip-test-list=unstable-tests --mysqld=--loose-innodb-flush-log-at-trx-commit=2
- perl mysql-test-run.pl --force --max-test-fail=10 --retry=2 --parallel=%parallel% --testcase-timeout=4 --suite=main --skip-test-list=unstable-tests --mysqld=--loose-innodb-flush-log-at-trx-commit=2

image: Visual Studio 2022
8 changes: 4 additions & 4 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <violite.h>
#include <my_sys.h>
#include <source_revision.h>
#if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
#if defined(HAVE_LOCALE_H)
#include <locale.h>
#endif

Expand Down Expand Up @@ -2681,6 +2681,9 @@ static void initialize_readline ()
/* Allow conditional parsing of the ~/.inputrc file. */
rl_readline_name= (char *) "mysql";
rl_terminal_name= getenv("TERM");
#ifdef HAVE_SETLOCALE
setlocale(LC_ALL,"");
#endif

/* Tell the completer that we want a crack first. */
#if defined(USE_NEW_READLINE_INTERFACE)
Expand All @@ -2689,9 +2692,6 @@ static void initialize_readline ()

rl_add_defun("magic-space", (rl_command_func_t *)&fake_magic_space, -1);
#elif defined(USE_LIBEDIT_INTERFACE)
#ifdef HAVE_LOCALE_H
setlocale(LC_ALL,""); /* so as libedit use isprint */
#endif
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= &no_completion;
rl_add_defun("magic-space", (Function*)&fake_magic_space, -1);
Expand Down
5 changes: 0 additions & 5 deletions cmake/os/FreeBSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ SET(EXECINFO_ROOT /usr/local CACHE INTERNAL "Where to find execinfo library and
INCLUDE_DIRECTORIES(${EXECINFO_ROOT}/include)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${EXECINFO_ROOT}/include)
SET(ENV{LIB} "$ENV{LIB}:${EXECINFO_ROOT}/lib")
FIND_LIBRARY(EXECINFO NAMES execinfo)
IF(EXECINFO)
SET(LIBEXECINFO ${EXECINFO})
ENDIF()

22 changes: 0 additions & 22 deletions cmake/os/OpenBSD.cmake

This file was deleted.

5 changes: 5 additions & 0 deletions cmake/os/WindowsCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,9 @@ SET(HAVE_SOCKPEERCRED CACHE INTERNAL "")
SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "")
SET(HAVE_GCC_C11_ATOMICS CACHE INTERNAL "")
SET(HAVE_VISIBILITY_HIDDEN CACHE INTERNAL "")
SET(HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC CACHE INTERNAL "")
SET(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC CACHE INTERNAL "")
SET(HAVE_MPROTECT CACHE INTERNAL "")
SET(HAVE_C__Werror CACHE INTERNAL "")
SET(HAVE_NANOSLEEP CACHE INTERNAL "")
ENDIF(MSVC)
2 changes: 2 additions & 0 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ IF(UNIX)
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
MY_SEARCH_LIBS(backtrace_symbols_fd execinfo LIBEXECINFO)

set(THREADS_PREFER_PTHREAD_FLAG ON)
FIND_PACKAGE(Threads)

Expand Down
30 changes: 15 additions & 15 deletions extra/mariabackup/ds_compress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef struct {
uint num;
pthread_mutex_t data_mutex;
pthread_cond_t data_cond;
pthread_cond_t done_cond;
my_bool data_avail;
my_bool cancelled;
const char *from;
Expand Down Expand Up @@ -231,25 +232,24 @@ compress_write(ds_file_t *file, const uchar *buf, size_t len)
thd = threads + i;

pthread_mutex_lock(&thd->data_mutex);
while (thd->data_avail == TRUE) {
pthread_cond_wait(&thd->data_cond,
while (!thd->to_len) {
pthread_cond_wait(&thd->done_cond,
&thd->data_mutex);
}

xb_a(threads[i].to_len > 0);

bool fail = ds_write(dest_file, "NEWBNEWB", 8) ||
write_uint64_le(dest_file,
comp_file->bytes_processed);
comp_file->bytes_processed += threads[i].from_len;
comp_file->bytes_processed += thd->from_len;

if (!fail) {
fail = write_uint32_le(dest_file, threads[i].adler) ||
ds_write(dest_file, threads[i].to,
threads[i].to_len);
fail = write_uint32_le(dest_file, thd->adler) ||
ds_write(dest_file, thd->to,
thd->to_len);
}

pthread_mutex_unlock(&threads[i].data_mutex);
thd->to_len = 0;
pthread_mutex_unlock(&thd->data_mutex);

if (fail) {
msg("compress: write to the destination stream "
Expand Down Expand Up @@ -337,6 +337,7 @@ destroy_worker_thread(comp_thread_ctxt_t *thd)
pthread_join(thd->id, NULL);

pthread_cond_destroy(&thd->data_cond);
pthread_cond_destroy(&thd->done_cond);
pthread_mutex_destroy(&thd->data_mutex);

my_free(thd->to);
Expand All @@ -350,22 +351,20 @@ create_worker_threads(uint n)
uint i;

threads = (comp_thread_ctxt_t *)
my_malloc(sizeof(comp_thread_ctxt_t) * n, MYF(MY_FAE));
my_malloc(n * sizeof *threads, MYF(MY_ZEROFILL|MY_FAE));

for (i = 0; i < n; i++) {
comp_thread_ctxt_t *thd = threads + i;

thd->num = i + 1;
thd->cancelled = FALSE;
thd->data_avail = FALSE;

thd->to = (char *) my_malloc(COMPRESS_CHUNK_SIZE +
MY_QLZ_COMPRESS_OVERHEAD,
MYF(MY_FAE));

/* Initialize and data mutex and condition var */
if (pthread_mutex_init(&thd->data_mutex, NULL) ||
pthread_cond_init(&thd->data_cond, NULL)) {
pthread_cond_init(&thd->data_cond, NULL) ||
pthread_cond_init(&thd->done_cond, NULL)) {
goto err;
}

Expand Down Expand Up @@ -416,7 +415,7 @@ compress_worker_thread_func(void *arg)

if (thd->cancelled)
break;

thd->data_avail = FALSE;
thd->to_len = qlz_compress(thd->from, thd->to, thd->from_len,
&thd->state);

Expand All @@ -431,6 +430,7 @@ compress_worker_thread_func(void *arg)

thd->adler = adler32(0x00000001, (uchar *) thd->to,
(uInt)thd->to_len);
pthread_cond_signal(&thd->done_cond);
}

pthread_mutex_unlock(&thd->data_mutex);
Expand Down
72 changes: 72 additions & 0 deletions mysql-test/include/ensure_binlog_row_event_columns.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Helper file to ensure that a binary log file properly writes the expected
# fields based on the binlog_row_image value.
#
# ==== Usage ====
#
# --let $expected_columns= (COLUMN_IDS)
# --let $binlog_filename= FILENAME
# --source include/count_binlog_row_event_columns.inc
#
# Parameters:
# expected_columns (list<uint>, in) : A list of positive integers which
# correspond to the column numbers that should be output in a binary
# log's write_rows event
# binlog_filename (string, in) : Name of the binary log file to analyze
#

if (!$expected_columns)
{
--die expected_columns parameter is required but was not set
}

if (!$binlog_filename)
{
--die binlog_filename parameter is required but was not set
}

--let $include_filename= ensure_binlog_row_event_columns.inc [$expected_columns]
--source include/begin_include_file.inc

--let $assert_file=$MYSQLTEST_VARDIR/tmp/binlog_decoded.out
--let mysqld_datadir=`select @@datadir`

--echo # MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
--exec $MYSQL_BINLOG $mysqld_datadir/$binlog_filename -vv > $assert_file

--echo # Verifying all expected column ids appear in binlog event output..
--let num_cols_found=0
--let last_expected_col= `SELECT GREATEST $expected_columns`
--let i= 1
while($i <= $last_expected_col)
{
# By default, assume the column is not expected to be in the binary log.
# If the column id is set in expected_columns, then override assertion
# parameters.
--let assert_count= 0
--let assert_text= Column @$i should not be in binary log

if (`SELECT $i IN $expected_columns`)
{
--let assert_count= 1
--let assert_text= Column @$i should be in binary log

--inc $num_cols_found
}

--let assert_select= @$i
--source include/assert_grep.inc

--inc $i
}
--echo # ..success

--echo # Verifying only expected column ids appear in binlog event output..
--let assert_count= $num_cols_found
--let assert_text= The binlog event should only have $num_cols_found columns
--let assert_select= @[\d]+
--source include/assert_grep.inc
--echo # ..success

--let $include_filename= ensure_binlog_row_event_columns.inc [$expected_columns]
--source include/end_include_file.inc
Loading

0 comments on commit 3bb36e9

Please sign in to comment.