Skip to content

Commit bb2e125

Browse files
committed
Merge 10.5 into 10.6
This excludes commit 040069f because it is specific to innodb_sync_debug, which had been removed in commit ff5d306.
2 parents e459ce8 + 0ad52e4 commit bb2e125

File tree

75 files changed

+341
-140
lines changed

Some content is hidden

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

75 files changed

+341
-140
lines changed

.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ IndentPPDirectives: None
7070
IndentWidth: 2
7171
IndentWrappedFunctionNames: false
7272
KeepEmptyLinesAtTheStartOfBlocks: true
73-
Language: Cpp
7473
MacroBlockBegin: ''
7574
MacroBlockEnd: ''
7675
MaxEmptyLinesToKeep: 1

client/mysqltest.cc

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ enum enum_commands {
397397
Q_IF,
398398
Q_DISABLE_PARSING, Q_ENABLE_PARSING,
399399
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
400-
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
400+
Q_WRITE_FILE, Q_WRITE_LINE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
401401
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
402402
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
403403
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
@@ -500,6 +500,7 @@ const char *command_names[]=
500500
"remove_file",
501501
"file_exists",
502502
"write_file",
503+
"write_line",
503504
"copy_file",
504505
"perl",
505506
"die",
@@ -4318,6 +4319,49 @@ void do_write_file(struct st_command *command)
43184319
do_write_file_command(command, FALSE);
43194320
}
43204321

4322+
/**
4323+
Write a line to the start of the file.
4324+
Truncates existing file, creates new one if it doesn't exist.
4325+
4326+
Usage
4327+
write_line <line> <filename>;
4328+
4329+
Example
4330+
--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
4331+
4332+
@note Both the file and the line parameters are evaluated
4333+
(can be variables).
4334+
4335+
@note This is a better alternative to
4336+
exec echo > file, as it doesn't depend on shell,
4337+
and can better handle sporadic file access errors caused
4338+
by antivirus or backup software on Windows.
4339+
*/
4340+
void do_write_line(struct st_command *command)
4341+
{
4342+
DYNAMIC_STRING ds_line;
4343+
DYNAMIC_STRING ds_filename;
4344+
4345+
struct command_arg write_line_args[] = {
4346+
{ "line", ARG_STRING, FALSE, &ds_line, "line to add" },
4347+
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
4348+
};
4349+
DBUG_ENTER("do_write_line");
4350+
4351+
check_command_args(command,
4352+
command->first_argument,
4353+
write_line_args,
4354+
sizeof(write_line_args)/sizeof(struct command_arg),
4355+
' ');
4356+
4357+
if (bad_path(ds_filename.str))
4358+
DBUG_VOID_RETURN;
4359+
dynstr_append_mem(&ds_line, "\n", 1);
4360+
str_to_file2(ds_filename.str, ds_line.str, ds_line.length, FALSE);
4361+
dynstr_free(&ds_filename);
4362+
dynstr_free(&ds_line);
4363+
DBUG_VOID_RETURN;
4364+
}
43214365

43224366
/*
43234367
SYNOPSIS
@@ -7435,7 +7479,7 @@ void str_to_file2(const char *fname, char *str, size_t size, my_bool append)
74357479
die("Could not open '%s' for writing, errno: %d", buff, errno);
74367480
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
74377481
die("Could not find end of file '%s', errno: %d", buff, errno);
7438-
if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
7482+
if (size > 0 && my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
74397483
die("write failed, errno: %d", errno);
74407484
my_close(fd, MYF(0));
74417485
}
@@ -10235,6 +10279,7 @@ int main(int argc, char **argv)
1023510279
break;
1023610280
case Q_FILE_EXIST: do_file_exist(command); break;
1023710281
case Q_WRITE_FILE: do_write_file(command); break;
10282+
case Q_WRITE_LINE: do_write_line(command); break;
1023810283
case Q_APPEND_FILE: do_append_file(command); break;
1023910284
case Q_DIFF_FILES: do_diff_files(command); break;
1024010285
case Q_SEND_QUIT: do_send_quit(command); break;

cmake/libutils.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,5 +379,11 @@ FUNCTION (MAYBE_DISABLE_IPO target)
379379
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF
380380
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF
381381
INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF)
382+
IF(CMAKE_CONFIGURATION_TYPES)
383+
FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES})
384+
STRING(TOUPPER "${cfg}" cfg_upper)
385+
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_${cfg_upper} OFF)
386+
ENDFOREACH()
387+
ENDIF()
382388
ENDIF()
383389
ENDFUNCTION()

cmake/mariadb_connector_c.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC)
4040
MESSAGE("== Configuring MariaDB Connector/C")
4141
ADD_SUBDIRECTORY(libmariadb)
4242

43+
IF(MSVC AND TARGET mariadb_obj AND TARGET mariadbclient)
44+
# With MSVC, do not produce LTCG-compiled static client libraries.
45+
# They are not usable by end-users, being tied to exact compiler version
46+
MAYBE_DISABLE_IPO(mariadb_obj)
47+
MAYBE_DISABLE_IPO(mariadbclient)
48+
ENDIF()
49+
4350
IF(UNIX)
4451
INSTALL(CODE "EXECUTE_PROCESS(
4552
COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR})

mysql-test/include/crash_mysqld.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--source include/not_embedded.inc
55

66
# Write file to make mysql-test-run.pl expect crash and restart
7-
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
7+
--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
88

99
# Setup the mysqld to crash at shutdown
1010
SET debug_dbug="d,crash_shutdown";

mysql-test/include/expect_crash.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
33

44
# There should be a debug crash after using this .inc file
5-
--exec echo "wait" > $_expect_file_name
5+
--write_line wait $_expect_file_name

mysql-test/include/kill_and_restart_mysqld.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (!$restart_parameters)
77
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
88

99
--echo # Kill and $restart_parameters
10-
--exec echo "$restart_parameters" > $_expect_file_name
10+
--write_line "$restart_parameters" $_expect_file_name
1111
--shutdown_server 0
1212
--source include/wait_until_disconnected.inc
1313
--enable_reconnect

mysql-test/include/kill_galera.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Write file to make mysql-test-run.pl expect the crash, but don't start it
44
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
55
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
6-
--exec echo "wait" > $_expect_file_name
6+
--write_line wait $_expect_file_name
77

88
# Kill the connected server
99
--disable_reconnect

mysql-test/include/kill_mysqld.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
33

44
--echo # Kill the server
5-
--exec echo "wait" > $_expect_file_name
5+
--write_line wait $_expect_file_name
66
--shutdown_server 0
77
--source include/wait_until_disconnected.inc

mysql-test/include/rpl_start_server.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if ($rpl_server_parameters)
4949
--source include/rpl_connection.inc
5050

5151
# Write file to make mysql-test-run.pl start up the server again
52-
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
52+
--write_line "$_rpl_start_server_command" $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
5353

5454
if (!$rpl_server_error)
5555
{

0 commit comments

Comments
 (0)