Skip to content

Commit

Permalink
Merge 10.8 into 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jul 28, 2022
2 parents d8c2eee + f79cebb commit f53f64b
Show file tree
Hide file tree
Showing 421 changed files with 20,430 additions and 8,758 deletions.
6 changes: 4 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ fedora-ninja:
- mkdir builddir; cd builddir
- cmake -DRPM=generic $CMAKE_FLAGS -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -G Ninja .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
- ninja -t graph > ../dependencies.dot && dot -Tpng -o ../dependencies.png ../dependencies.dot
- eatmydata ninja package --verbose 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
# Ninja builds are not affected by bug https://jira.mariadb.org/browse/MDEV-25968
- eatmydata ninja package -j 2 --verbose 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
# @TODO: Unlike other builds, the Ninja builds using Gitlab.com runners don't get stuck, but they do get
# stuck on runners with more processors, see https://jira.mariadb.org/browse/MDEV-25968.
# Thus, use the same limitation on Ninja builds as well to ensure it never gets stuck due to this bug.
- ninja test
- *rpm_listfiles
- mkdir ../rpm; mv *.rpm ../rpm
Expand Down
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=%APPVEYOR_BUILD_FOLDER%\win\appveyor_skip_tests.txt --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=%APPVEYOR_BUILD_FOLDER%\win\appveyor_skip_tests.txt --mysqld=--loose-innodb-flush-log-at-trx-commit=2

image: Visual Studio 2022
17 changes: 8 additions & 9 deletions client/mysql.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 2021, MariaDB Corporation.
Copyright (c) 2009, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down 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 @@ -2857,6 +2857,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 @@ -2865,9 +2868,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 Expand Up @@ -3791,7 +3791,6 @@ print_table_data(MYSQL_RES *result)
{
String separator(256);
MYSQL_ROW cur;
MYSQL_FIELD *field;
bool *num_flag;

num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
Expand All @@ -3803,7 +3802,7 @@ print_table_data(MYSQL_RES *result)
mysql_field_seek(result,0);
}
separator.copy("+",1,charset_info);
while ((field = mysql_fetch_field(result)))
while (MYSQL_FIELD *field= mysql_fetch_field(result))
{
uint length= column_names ? field->name_length : 0;
if (quick)
Expand All @@ -3825,7 +3824,7 @@ print_table_data(MYSQL_RES *result)
{
mysql_field_seek(result,0);
(void) tee_fputs("|", PAGER);
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
while (MYSQL_FIELD *field= mysql_fetch_field(result))
{
size_t name_length= (uint) strlen(field->name);
size_t numcells= charset_info->numcells(field->name,
Expand Down Expand Up @@ -3867,7 +3866,7 @@ print_table_data(MYSQL_RES *result)
data_length= (uint) lengths[off];
}

field= mysql_fetch_field(result);
MYSQL_FIELD *field= mysql_fetch_field(result);
field_max_length= field->max_length;

/*
Expand Down
5 changes: 2 additions & 3 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2017, MariaDB
Copyright (c) 2010, 2012, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1061,7 +1061,6 @@ static void print_result()
char prev[(NAME_LEN+9)*3+2];
char prev_alter[MAX_ALTER_STR_SIZE];
size_t length_of_db= strlen(sock->db);
uint i;
my_bool found_error=0, table_rebuild=0;
DYNAMIC_ARRAY *array4repair= &tables4repair;
DBUG_ENTER("print_result");
Expand All @@ -1070,7 +1069,7 @@ static void print_result()

prev[0] = '\0';
prev_alter[0]= 0;
for (i = 0; (row = mysql_fetch_row(res)); i++)
while ((row = mysql_fetch_row(res)))
{
int changed = strcmp(prev, row[0]);
my_bool status = !strcmp(row[2], "status");
Expand Down
12 changes: 5 additions & 7 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2017, MariaDB
Copyright (c) 2010, 2022, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1897,12 +1897,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)

pthread_handler_t run_task(void *p)
{
ulonglong counter= 0, queries;
ulonglong queries;
ulonglong detach_counter;
unsigned int commit_counter;
MYSQL *mysql;
MYSQL_RES *result;
MYSQL_ROW row;
statement *ptr;
thread_context *con= (thread_context *)p;

Expand Down Expand Up @@ -2023,8 +2022,7 @@ pthread_handler_t run_task(void *p)
my_progname, mysql_errno(mysql), mysql_error(mysql));
else
{
while ((row= mysql_fetch_row(result)))
counter++;
while (mysql_fetch_row(result)) {}
mysql_free_result(result);
}
}
Expand All @@ -2034,7 +2032,7 @@ pthread_handler_t run_task(void *p)
if (commit_rate && (++commit_counter == commit_rate))
{
commit_counter= 0;
run_query(mysql, "COMMIT", strlen("COMMIT"));
run_query(mysql, C_STRING_WITH_LEN("COMMIT"));
}

if (con->limit && queries == con->limit)
Expand All @@ -2046,7 +2044,7 @@ pthread_handler_t run_task(void *p)

end:
if (commit_rate)
run_query(mysql, "COMMIT", strlen("COMMIT"));
run_query(mysql, C_STRING_WITH_LEN("COMMIT"));

mysql_close(mysql);

Expand Down
2 changes: 1 addition & 1 deletion cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2021, MariaDB Corporation.
# Copyright (c) 2011, 2022, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 5 additions & 1 deletion cmake/libutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# (can be a static or shared lib)
IF(LIB_TYPE STREQUAL "STATIC_LIBRARY")
SET(STATIC_TGTS ${STATIC_TGTS} ${LIB})
SET(STATIC_LIBS ${STATIC_LIBS} $<TARGET_FILE:${LIB}>)
IF(MSVC)
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ${LIB})
ELSE()
SET(STATIC_LIBS ${STATIC_LIBS} $<TARGET_FILE:${LIB}>)
ENDIF()
ADD_DEPENDENCIES(${TARGET} ${LIB})
# Extract dependent OS libraries
GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
Expand Down
4 changes: 0 additions & 4 deletions cmake/os/FreeBSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +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 @@ -296,6 +296,11 @@ 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 "")
SET(HAVE_ACCEPT4 CACHE INTERNAL "")
SET(HAVE_LINK_H CACHE INTERNAL "")
SET(HAVE_DLADDR CACHE INTERNAL "")
Expand Down
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
4 changes: 1 addition & 3 deletions dbug/my_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
#include <my_sys.h>
#include <my_pthread.h>

int main (argc, argv)
int argc;
char *argv[];
int main (int argc, char **argv)
{
register int result, ix;
extern int factorial(int);
Expand Down
40 changes: 22 additions & 18 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 @@ -229,25 +230,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 @@ -335,6 +335,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 @@ -347,22 +348,24 @@ create_worker_threads(uint n)
comp_thread_ctxt_t *threads;
uint i;

threads = (comp_thread_ctxt_t *) my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(comp_thread_ctxt_t) * n, MYF(MY_FAE));
threads = static_cast<comp_thread_ctxt_t*>
(my_malloc(PSI_NOT_INSTRUMENTED, 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(PSI_NOT_INSTRUMENTED,
COMPRESS_CHUNK_SIZE + MY_QLZ_COMPRESS_OVERHEAD, MYF(MY_FAE));
thd->to = static_cast<char*>
(my_malloc(PSI_NOT_INSTRUMENTED,
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 @@ -413,7 +416,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 @@ -428,6 +431,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
Loading

0 comments on commit f53f64b

Please sign in to comment.