Skip to content

Commit ff33f49

Browse files
committed
Merge 11.4 into 11.8
2 parents 2667b54 + 62c70a8 commit ff33f49

File tree

452 files changed

+9282
-4968
lines changed

Some content is hidden

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

452 files changed

+9282
-4968
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/mysql.cc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,9 +1404,7 @@ int main(int argc,char *argv[])
14041404
if (opt_outfile)
14051405
end_tee();
14061406
mysql_end(0);
1407-
#ifndef _lint
1408-
DBUG_RETURN(0); // Keep compiler happy
1409-
#endif
1407+
DBUG_RETURN(0);
14101408
}
14111409

14121410
sig_handler mysql_end(int sig)
@@ -2890,7 +2888,9 @@ static void fix_history(String *final_command)
28902888
ptr++;
28912889
}
28922890
if (total_lines > 1)
2893-
add_history(fixed_buffer.ptr());
2891+
{
2892+
add_history(fixed_buffer.c_ptr());
2893+
}
28942894
}
28952895

28962896
/*
@@ -3213,6 +3213,12 @@ static int reconnect(void)
32133213
}
32143214

32153215
#ifndef EMBEDDED_LIBRARY
3216+
#ifdef __clang__
3217+
#pragma clang diagnostic push
3218+
#pragma clang diagnostic ignored "-Wvarargs"
3219+
/* CONC-789 */
3220+
#endif
3221+
32163222
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32173223
{
32183224
va_list ap;
@@ -3228,6 +3234,10 @@ static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32283234
}
32293235
va_end(ap);
32303236
}
3237+
3238+
#ifdef __clang__
3239+
#pragma clang diagnostic pop
3240+
#endif
32313241
#else
32323242
#define mysql_optionsv(A,B,C,D) do { } while(0)
32333243
#endif
@@ -3511,8 +3521,6 @@ static int com_go(String *buffer, char *)
35113521
old_buffer.copy();
35123522
}
35133523

3514-
/* Remove garbage for nicer messages */
3515-
LINT_INIT_STRUCT(buff[0]);
35163524
remove_cntrl(*buffer);
35173525

35183526
if (buffer->is_empty())

client/mysqldump.cc

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,6 +1942,26 @@ static char *cover_definer_clause(const char *stmt_str,
19421942
return query_str;
19431943
}
19441944

1945+
1946+
static const char* build_path_for_table(char *to, const char *dir,
1947+
const char *table, const char *ext)
1948+
{
1949+
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
1950+
convert_dirname(tmp_path, dir, NULL);
1951+
my_load_path(tmp_path, tmp_path, NULL);
1952+
if (check_if_legal_tablename(table))
1953+
strxnmov(filename, sizeof(filename) - 1, table, "@@@", NULL);
1954+
else
1955+
{
1956+
uint errors, len;
1957+
len= my_convert(filename, sizeof(filename) - 1, &my_charset_filename,
1958+
table, (uint32)strlen(table), charset_info, &errors);
1959+
filename[len]= 0;
1960+
}
1961+
return fn_format(to, filename, tmp_path, ext, MYF(MY_UNPACK_FILENAME));
1962+
}
1963+
1964+
19451965
/*
19461966
Open a new .sql file to dump the table or view into
19471967
@@ -1957,7 +1977,7 @@ static char *cover_definer_clause(const char *stmt_str,
19571977
static FILE* open_sql_file_for_table(const char *db, const char* table, int flags)
19581978
{
19591979
FILE* res;
1960-
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
1980+
char filename[FN_REFLEN];
19611981
char out_dir_buf[FN_REFLEN];
19621982

19631983
char *out_dir= path;
@@ -1967,8 +1987,7 @@ static FILE* open_sql_file_for_table(const char *db, const char* table, int flag
19671987
my_snprintf(out_dir_buf, sizeof(out_dir_buf), "%s/%s", opt_dir, db);
19681988
}
19691989

1970-
convert_dirname(tmp_path, out_dir, NullS);
1971-
res= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
1990+
res= my_fopen(build_path_for_table(filename, out_dir, table, ".sql"),
19721991
flags, MYF(MY_WME));
19731992
return res;
19741993
}
@@ -4290,7 +4309,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
42904309

42914310
if (multi_file_output)
42924311
{
4293-
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
4312+
char filename[FN_REFLEN];
42944313
char out_dir_buf[FN_REFLEN];
42954314
char *out_dir= path;
42964315
if (!out_dir)
@@ -4303,9 +4322,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
43034322
Convert the path to native os format
43044323
and resolve to the full filepath.
43054324
*/
4306-
convert_dirname(tmp_path,out_dir,NullS);
4307-
my_load_path(tmp_path, tmp_path, NULL);
4308-
fn_format(filename, table, tmp_path, ".txt", MYF(MY_UNPACK_FILENAME));
4325+
build_path_for_table(filename, out_dir, table, ".txt");
43094326

43104327
/* Must delete the file that 'INTO OUTFILE' will write to */
43114328
my_delete(filename, MYF(0));
@@ -4314,7 +4331,6 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
43144331
to_unix_path(filename);
43154332

43164333
/* now build the query string */
4317-
43184334
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ ");
43194335
dynstr_append_checked(&query_string, select_field_names.str);
43204336
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: 14 additions & 2 deletions
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
{
@@ -5800,8 +5808,12 @@ void do_close_connection(struct st_command *command)
58005808
DBUG_PRINT("info", ("Closing connection %s", con->name));
58015809
#ifndef EMBEDDED_LIBRARY
58025810
if (command->type == Q_DIRTY_CLOSE)
5803-
{
58045811
mariadb_cancel(con->mysql);
5812+
else
5813+
{
5814+
simple_command(con->mysql,COM_QUIT,0,0,0);
5815+
if (con->util_mysql)
5816+
simple_command(con->util_mysql,COM_QUIT,0,0,0);
58055817
}
58065818
#endif /*!EMBEDDED_LIBRARY*/
58075819
if (con->stmt)

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/mariadb-server.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ usr/bin/wsrep_sst_mysqldump
3636
usr/bin/wsrep_sst_rsync
3737
usr/bin/wsrep_sst_rsync_wan
3838
usr/lib/mysql/plugin/auth_ed25519.so
39+
usr/lib/mysql/plugin/auth_mysql_sha2.so
3940
usr/lib/mysql/plugin/auth_pam.so
4041
usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
4142
usr/lib/mysql/plugin/auth_pam_v1.so

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)