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

Merge branch '10.6' into 10.11

This commit is contained in:
Sergei Golubchik
2025-01-30 11:55:13 +01:00
344 changed files with 8502 additions and 2511 deletions

View File

@@ -160,6 +160,8 @@ static Server_gtid_event_filter *server_id_gtid_filter= NULL;
static char *start_datetime_str, *stop_datetime_str;
static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX;
static my_time_t last_processed_datetime= MY_TIME_T_MAX;
static ulonglong rec_count= 0;
static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0;
@@ -1034,6 +1036,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
DBUG_ENTER("process_event");
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
my_time_t ev_when= ev->when;
/*
We use Gtid_list_log_event information to determine if there is missing
@@ -1608,6 +1611,7 @@ err:
end:
rec_count++;
end_skip_count:
last_processed_datetime= ev_when;
DBUG_PRINT("info", ("end event processing"));
/*
@@ -3220,6 +3224,7 @@ static Exit_status check_header(IO_CACHE* file,
uchar buf[PROBE_HEADER_LEN];
my_off_t tmp_pos, pos;
MY_STAT my_file_stat;
int read_error;
delete glob_description_event;
if (!(glob_description_event= new Format_description_log_event(3)))
@@ -3320,7 +3325,8 @@ static Exit_status check_header(IO_CACHE* file,
Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(new_description_event= (Format_description_log_event*)
Log_event::read_log_event(file, glob_description_event,
Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum)))
/* EOF can't be hit here normally, so it's a real error */
{
@@ -3353,7 +3359,8 @@ static Exit_status check_header(IO_CACHE* file,
{
Log_event *ev;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(ev= Log_event::read_log_event(file, glob_description_event,
if (!(ev= Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum)))
{
/* EOF can't be hit here normally, so it's a real error */
@@ -3393,7 +3400,6 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
IO_CACHE cache,*file= &cache;
uchar tmp_buff[BIN_LOG_HEADER_SIZE];
Exit_status retval= OK_CONTINUE;
my_time_t last_ev_when= MY_TIME_T_MAX;
if (logname && strcmp(logname, "-") != 0)
{
@@ -3467,8 +3473,10 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
{
char llbuff[21];
my_off_t old_off = my_b_tell(file);
int read_error;
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
Log_event* ev = Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum);
if (!ev)
{
@@ -3477,15 +3485,15 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
about a corruption, but treat it as EOF and move to the next binlog.
*/
if (glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
file->error= 0;
else if (file->error)
read_error= 0;
else if (read_error)
{
error("Could not read entry at offset %s: "
"Error in log format or read error.",
llstr(old_off,llbuff));
goto err;
}
// else file->error == 0 means EOF, that's OK, we break in this case
// else read_error == 0 means EOF, that's OK, we break in this case
/*
Emit a warning in the event that we finished processing input
@@ -3499,21 +3507,8 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
"end of input", stop_position);
}
/*
Emit a warning in the event that we finished processing input
before reaching the boundary indicated by --stop-datetime.
*/
if (stop_datetime != MY_TIME_T_MAX &&
stop_datetime > last_ev_when)
{
retval = OK_STOP;
warning("Did not reach stop datetime '%s' "
"before end of input", stop_datetime_str);
}
goto end;
}
last_ev_when= ev->when;
if ((retval= process_event(print_event_info, ev, old_off, logname)) !=
OK_CONTINUE)
goto end;
@@ -3692,6 +3687,11 @@ int main(int argc, char** argv)
start_position= BIN_LOG_HEADER_SIZE;
}
if (stop_datetime != MY_TIME_T_MAX &&
stop_datetime > last_processed_datetime)
warning("Did not reach stop datetime '%s' before end of input",
stop_datetime_str);
/*
If enable flashback, need to print the events from the end to the
beginning