1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge remote-tracking branch '10.4' into 10.5

This commit is contained in:
Oleksandr Byelkin
2023-03-31 21:32:41 +02:00
306 changed files with 10920 additions and 6615 deletions

View File

@@ -1832,15 +1832,20 @@ static void cleanup()
my_free_open_file_info();
load_processor.destroy();
mysql_server_end();
if (opt_flashback)
{
delete_dynamic(&binlog_events);
delete_dynamic(&events_in_stmt);
}
DBUG_VOID_RETURN;
}
static void die()
static void die(int err)
{
cleanup();
my_end(MY_DONT_FREE_DBUG);
exit(1);
exit(err);
}
@@ -1877,7 +1882,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings)
{
error("Incorrect date and time argument: %s", str);
die();
die(1);
}
/*
Note that Feb 30th, Apr 31st cause no error messages and are mapped to
@@ -1940,7 +1945,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *)
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
die();
die(1);
}
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
@@ -1961,7 +1966,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *)
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
die();
die(1);
}
opt_base64_output_mode= (enum_base64_output_mode)(val - 1);
break;
@@ -2046,7 +2051,7 @@ static int parse_args(int *argc, char*** argv)
if ((ho_error=handle_options(argc, argv, my_options, get_one_option)))
{
die();
die(ho_error);
}
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
@@ -3003,6 +3008,12 @@ int main(int argc, char** argv)
my_set_max_open_files(open_files_limit);
if (opt_flashback && opt_raw_mode)
{
error("The --raw mode is not allowed with --flashback mode");
die(1);
}
if (opt_flashback)
{
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &binlog_events,
@@ -3018,7 +3029,7 @@ int main(int argc, char** argv)
if (!remote_opt)
{
error("The --raw mode only works with --read-from-remote-server");
die();
die(1);
}
if (one_database)
warning("The --database option is ignored in raw mode");
@@ -3040,7 +3051,7 @@ int main(int argc, char** argv)
O_WRONLY | O_BINARY, MYF(MY_WME))))
{
error("Could not create log file '%s'", result_file_name);
die();
die(1);
}
}
else
@@ -3129,7 +3140,7 @@ int main(int argc, char** argv)
/* Set delimiter back to semicolon */
if (retval != ERROR_STOP)
{
if (!stop_event_string.is_empty())
if (!stop_event_string.is_empty() && result_file)
fprintf(result_file, "%s", stop_event_string.ptr());
if (!opt_raw_mode && opt_flashback)
fprintf(result_file, "DELIMITER ;\n");