Skip to content

Commit c976b52

Browse files
committed
Merge branch '11.8' into bb-12.1-release
2 parents 38828f2 + 5eeccca commit c976b52

File tree

549 files changed

+13972
-7666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+13972
-7666
lines changed

BUILD/compile-pentium64-ubsan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ path=`dirname $0`
3131
# the destination
3232
#
3333

34-
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
34+
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized -Wno-unused-parameter"
3535
extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider"
3636

3737
. "$path/FINISH.sh"

client/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ TARGET_LINK_LIBRARIES(import_util PRIVATE pcre2-posix pcre2-8)
6464
TARGET_INCLUDE_DIRECTORIES(import_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
6565

6666
MYSQL_ADD_EXECUTABLE(mariadb-import mysqlimport.cc)
67-
TARGET_INCLUDE_DIRECTORIES(mariadb-import PRIVATE ${CMAKE_SOURCE_DIR}/tpool)
68-
TARGET_LINK_LIBRARIES(mariadb-import PRIVATE tpool ${CLIENT_LIB} import_util)
67+
TARGET_LINK_LIBRARIES(mariadb-import PRIVATE tpool_min ${CLIENT_LIB} import_util)
6968

7069

7170
MYSQL_ADD_EXECUTABLE(mariadb-upgrade mysql_upgrade.c COMPONENT Server)

client/mysql.cc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,9 +1409,7 @@ int main(int argc,char *argv[])
14091409
if (opt_outfile)
14101410
end_tee();
14111411
mysql_end(0);
1412-
#ifndef _lint
1413-
DBUG_RETURN(0); // Keep compiler happy
1414-
#endif
1412+
DBUG_RETURN(0);
14151413
}
14161414

14171415
sig_handler mysql_end(int sig)
@@ -2912,7 +2910,9 @@ static void fix_history(String *final_command)
29122910
ptr++;
29132911
}
29142912
if (total_lines > 1)
2915-
add_history(fixed_buffer.ptr());
2913+
{
2914+
add_history(fixed_buffer.c_ptr());
2915+
}
29162916
}
29172917

29182918
/*
@@ -3235,6 +3235,12 @@ static int reconnect(void)
32353235
}
32363236

32373237
#ifndef EMBEDDED_LIBRARY
3238+
#ifdef __clang__
3239+
#pragma clang diagnostic push
3240+
#pragma clang diagnostic ignored "-Wvarargs"
3241+
/* CONC-789 */
3242+
#endif
3243+
32383244
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32393245
{
32403246
va_list ap;
@@ -3250,6 +3256,10 @@ static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32503256
}
32513257
va_end(ap);
32523258
}
3259+
3260+
#ifdef __clang__
3261+
#pragma clang diagnostic pop
3262+
#endif
32533263
#else
32543264
#define mysql_optionsv(A,B,C,D) do { } while(0)
32553265
#endif
@@ -3533,8 +3543,6 @@ static int com_go(String *buffer, char *)
35333543
old_buffer.copy();
35343544
}
35353545

3536-
/* Remove garbage for nicer messages */
3537-
LINT_INIT_STRUCT(buff[0]);
35383546
remove_cntrl(*buffer);
35393547

35403548
if (buffer->is_empty())

client/mysqldump.cc

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,26 @@ static char *cover_definer_clause(const char *stmt_str,
19491949
return query_str;
19501950
}
19511951

1952+
1953+
static const char* build_path_for_table(char *to, const char *dir,
1954+
const char *table, const char *ext)
1955+
{
1956+
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
1957+
convert_dirname(tmp_path, dir, NULL);
1958+
my_load_path(tmp_path, tmp_path, NULL);
1959+
if (check_if_legal_tablename(table))
1960+
strxnmov(filename, sizeof(filename) - 1, table, "@@@", NULL);
1961+
else
1962+
{
1963+
uint errors, len;
1964+
len= my_convert(filename, sizeof(filename) - 1, &my_charset_filename,
1965+
table, (uint32)strlen(table), charset_info, &errors);
1966+
filename[len]= 0;
1967+
}
1968+
return fn_format(to, filename, tmp_path, ext, MYF(MY_UNPACK_FILENAME));
1969+
}
1970+
1971+
19521972
/*
19531973
Open a new .sql file to dump the table or view into
19541974
@@ -1964,7 +1984,7 @@ static char *cover_definer_clause(const char *stmt_str,
19641984
static FILE* open_sql_file_for_table(const char *db, const char* table, int flags)
19651985
{
19661986
FILE* res;
1967-
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
1987+
char filename[FN_REFLEN];
19681988
char out_dir_buf[FN_REFLEN];
19691989

19701990
char *out_dir= path;
@@ -1974,8 +1994,7 @@ static FILE* open_sql_file_for_table(const char *db, const char* table, int flag
19741994
my_snprintf(out_dir_buf, sizeof(out_dir_buf), "%s/%s", opt_dir, db);
19751995
}
19761996

1977-
convert_dirname(tmp_path, out_dir, NullS);
1978-
res= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
1997+
res= my_fopen(build_path_for_table(filename, out_dir, table, ".sql"),
19791998
flags, MYF(MY_WME));
19801999
return res;
19812000
}
@@ -4297,7 +4316,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
42974316

42984317
if (multi_file_output)
42994318
{
4300-
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
4319+
char filename[FN_REFLEN];
43014320
char out_dir_buf[FN_REFLEN];
43024321
char *out_dir= path;
43034322
if (!out_dir)
@@ -4310,9 +4329,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
43104329
Convert the path to native os format
43114330
and resolve to the full filepath.
43124331
*/
4313-
convert_dirname(tmp_path,out_dir,NullS);
4314-
my_load_path(tmp_path, tmp_path, NULL);
4315-
fn_format(filename, table, tmp_path, ".txt", MYF(MY_UNPACK_FILENAME));
4332+
build_path_for_table(filename, out_dir, table, ".txt");
43164333

43174334
/* Must delete the file that 'INTO OUTFILE' will write to */
43184335
my_delete(filename, MYF(0));
@@ -4321,7 +4338,6 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
43214338
to_unix_path(filename);
43224339

43234340
/* now build the query string */
4324-
43254341
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ ");
43264342
dynstr_append_checked(&query_string, select_field_names.str);
43274343
dynstr_append_checked(&query_string, " INTO OUTFILE '");

client/mysqlimport.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,17 @@ int table_load_params::load_data(MYSQL *mysql)
667667

668668
const char *filename= data_file.c_str();
669669

670-
fn_format(tablename, filename, "", "", 1 | 2); /* removes path & ext. */
670+
fn_format(tablename, filename, "", "", MYF(MY_REPLACE_DIR | MY_REPLACE_EXT));
671+
if (strchr(tablename, '@'))
672+
{
673+
uint errors, len;
674+
CHARSET_INFO *cs=
675+
get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(0));
676+
len= my_convert(escaped_name, sizeof(escaped_name) - 1, cs, tablename,
677+
(uint32)strlen(tablename), &my_charset_filename, &errors);
678+
if (!errors)
679+
strmake(tablename, escaped_name, len);
680+
}
671681

672682
const char *db= current_db ? current_db : dbname.c_str();
673683
std::string full_tablename= quote_identifier(db);
@@ -872,7 +882,7 @@ static MYSQL *db_connect(char *host, char *database,
872882
if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME))
873883
default_charset= (char *)my_default_csname();
874884
my_set_console_cp(default_charset);
875-
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, my_default_csname());
885+
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
876886
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
877887
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
878888
"program_name", "mysqlimport");

client/mysqltest.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#endif
5656
#include <signal.h>
5757
#include <my_stacktrace.h>
58+
#include <my_attribute.h>
5859

5960
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
6061

@@ -78,7 +79,7 @@ static my_bool non_blocking_api_enabled= 0;
7879
#define MAX_DELIMITER_LENGTH 16
7980
#define DEFAULT_MAX_CONN 64
8081

81-
#define DIE_BUFF_SIZE 15*1024
82+
#define DIE_BUFF_SIZE 64*1024
8283

8384
#define RESULT_STRING_INIT_MEM 2048
8485
#define RESULT_STRING_INCREMENT_MEM 2048
@@ -1631,6 +1632,8 @@ static void make_error_message(char *buf, size_t len, const char *fmt, va_list a
16311632
s+= my_snprintf(s, end -s, "\n");
16321633
}
16331634

1635+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1636+
16341637
static void die(const char *fmt, ...)
16351638
{
16361639
char buff[DIE_BUFF_SIZE];
@@ -1642,6 +1645,8 @@ static void die(const char *fmt, ...)
16421645
really_die(buff);
16431646
}
16441647

1648+
PRAGMA_REENABLE_CHECK_STACK_FRAME
1649+
16451650
static void really_die(const char *msg)
16461651
{
16471652
static int dying= 0;
@@ -1670,6 +1675,8 @@ static void really_die(const char *msg)
16701675
cleanup_and_exit(1, 1);
16711676
}
16721677

1678+
PRAGMA_DISABLE_CHECK_STACK_FRAME
1679+
16731680
void report_or_die(const char *fmt, ...)
16741681
{
16751682
va_list args;
@@ -1724,6 +1731,7 @@ void abort_not_supported_test(const char *fmt, ...)
17241731
cleanup_and_exit(62, 0);
17251732
}
17261733

1734+
PRAGMA_REENABLE_CHECK_STACK_FRAME
17271735

17281736
void abort_not_in_this_version()
17291737
{

cmake/cpack_rpm.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ IF(RPM MATCHES "fedora")
341341
ALTERNATIVE_NAME("shared" "mariadb-connector-c" ${MARIADB_CONNECTOR_C_VERSION}-1)
342342
ENDIF()
343343

344+
IF(RPM MATCHES "fedora|rhel|centos" AND NOT RPM MATCHES "rhel[78]")
345+
SETA(CPACK_RPM_server_PACKAGE_REQUIRES "(mysql-selinux >= 1.0.14 if selinux-policy-targeted)")
346+
ENDIF()
344347
SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang")
345348

346349
################

cmake/maintainer.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS
6767
SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=non-virtual-dtor) # gcc bug 7302
6868
ENDIF()
6969

70+
FOREACH(LANG C CXX)
71+
IF(CMAKE_${LANG}_COMPILER_ID MATCHES "Clang")
72+
MY_CHECK_AND_SET_COMPILER_FLAG(-Werror=uninitialized-explicit-init)
73+
MY_CHECK_AND_SET_COMPILER_FLAG(-Werror=uninitialized-const-reference)
74+
SET(CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} -Werror=uninitialized")
75+
ENDIF()
76+
ENDFOREACH()
77+
7078
IF(MYSQL_MAINTAINER_MODE MATCHES "OFF|WARN")
7179
RETURN()
7280
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")

debian/control

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,7 @@ Description: Backup tool for MariaDB server
937937

938938
Package: mariadb-plugin-connect
939939
Architecture: any
940-
Depends: libxml2,
941-
mariadb-server (= ${server:Version}),
940+
Depends: mariadb-server (= ${server:Version}),
942941
unixodbc,
943942
${misc:Depends},
944943
${shlibs:Depends}

extra/mariabackup/aria_backup_client.cc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,19 @@ bool Table::copy(ds_ctxt_t *ds, bool is_index, unsigned thread_num) {
399399

400400
for (ulonglong block= 0 ; ; block++) {
401401
size_t length = m_cap.block_size;
402-
if (is_index) {
403-
if ((error= aria_read_index(
404-
partition.m_index_file, &m_cap, block, copy_buffer) ==
405-
HA_ERR_END_OF_FILE))
406-
break;
407-
} else {
408-
if ((error= aria_read_data(
409-
partition.m_data_file, &m_cap, block, copy_buffer, &length) ==
410-
HA_ERR_END_OF_FILE))
411-
break;
412-
}
413-
if (error) {
414-
msg(thread_num, "error: aria_read %s failed: %d",
415-
is_index ? "index" : "data", error);
416-
goto err;
402+
if (is_index)
403+
error= aria_read_index(partition.m_index_file, &m_cap,
404+
block, copy_buffer);
405+
else
406+
error= aria_read_data(partition.m_data_file, &m_cap,
407+
block, copy_buffer, &length);
408+
if (error)
409+
{
410+
if (error == HA_ERR_END_OF_FILE)
411+
break;
412+
msg(thread_num, "error: aria_read %s failed: %d",
413+
is_index ? "index" : "data", error);
414+
goto err;
417415
}
418416
xtrabackup_io_throttling();
419417
if ((error = ds_write(dst_file, copy_buffer, length))) {

0 commit comments

Comments
 (0)