mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
cleanup: reformat
* reformat long lines * remove useless 'const' * remove unneeded do { ... } while(false} wrapper * remove unneeded method
This commit is contained in:
@ -4439,12 +4439,6 @@ end:
|
|||||||
DBUG_RETURN(thd->is_slave_error);
|
DBUG_RETURN(thd->is_slave_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Query_log_event::do_update_pos(rpl_group_info *rgi)
|
|
||||||
{
|
|
||||||
return Log_event::do_update_pos(rgi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Log_event::enum_skip_reason
|
Log_event::enum_skip_reason
|
||||||
Query_log_event::do_shall_skip(rpl_group_info *rgi)
|
Query_log_event::do_shall_skip(rpl_group_info *rgi)
|
||||||
{
|
{
|
||||||
@ -4980,7 +4974,7 @@ bool Format_description_log_event::write(IO_CACHE* file)
|
|||||||
slave does it via marking the event according to
|
slave does it via marking the event according to
|
||||||
FD_queue checksum_alg value.
|
FD_queue checksum_alg value.
|
||||||
*/
|
*/
|
||||||
compile_time_assert(sizeof(BINLOG_CHECKSUM_ALG_DESC_LEN == 1));
|
compile_time_assert(BINLOG_CHECKSUM_ALG_DESC_LEN == 1);
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
data_written= 0; // to prepare for need_checksum assert
|
data_written= 0; // to prepare for need_checksum assert
|
||||||
#endif
|
#endif
|
||||||
@ -5019,7 +5013,7 @@ bool Format_description_log_event::write(IO_CACHE* file)
|
|||||||
int Format_description_log_event::do_apply_event(rpl_group_info *rgi)
|
int Format_description_log_event::do_apply_event(rpl_group_info *rgi)
|
||||||
{
|
{
|
||||||
int ret= 0;
|
int ret= 0;
|
||||||
Relay_log_info const *rli= rgi->rli;
|
Relay_log_info *rli= rgi->rli;
|
||||||
DBUG_ENTER("Format_description_log_event::do_apply_event");
|
DBUG_ENTER("Format_description_log_event::do_apply_event");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5067,7 +5061,7 @@ int Format_description_log_event::do_apply_event(rpl_group_info *rgi)
|
|||||||
{
|
{
|
||||||
/* Save the information describing this binlog */
|
/* Save the information describing this binlog */
|
||||||
delete rli->relay_log.description_event_for_exec;
|
delete rli->relay_log.description_event_for_exec;
|
||||||
const_cast<Relay_log_info *>(rli)->relay_log.description_event_for_exec= this;
|
rli->relay_log.description_event_for_exec= this;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_RETURN(ret);
|
DBUG_RETURN(ret);
|
||||||
|
@ -2014,7 +2014,6 @@ public: /* !!! Public in this patch to allow old usage */
|
|||||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||||
virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi);
|
virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi);
|
||||||
virtual int do_apply_event(rpl_group_info *rgi);
|
virtual int do_apply_event(rpl_group_info *rgi);
|
||||||
virtual int do_update_pos(rpl_group_info *rgi);
|
|
||||||
|
|
||||||
int do_apply_event(rpl_group_info *rgi,
|
int do_apply_event(rpl_group_info *rgi,
|
||||||
const char *query_arg,
|
const char *query_arg,
|
||||||
|
@ -2193,10 +2193,8 @@ static int init_binlog_sender(binlog_send_info *info,
|
|||||||
/**
|
/**
|
||||||
* send format descriptor event for one binlog file
|
* send format descriptor event for one binlog file
|
||||||
*/
|
*/
|
||||||
static int send_format_descriptor_event(binlog_send_info *info,
|
static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
|
||||||
IO_CACHE *log,
|
LOG_INFO *linfo, my_off_t start_pos)
|
||||||
LOG_INFO *linfo,
|
|
||||||
my_off_t start_pos)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
ulong ev_offset;
|
ulong ev_offset;
|
||||||
@ -2220,11 +2218,9 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
/* reset transmit packet for the event read from binary log file */
|
/* reset transmit packet for the event read from binary log file */
|
||||||
if (reset_transmit_packet(info, info->flags, &ev_offset, &info->errmsg))
|
if (reset_transmit_packet(info, info->flags, &ev_offset, &info->errmsg))
|
||||||
break;
|
return 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Try to find a Format_description_log_event at the beginning of
|
Try to find a Format_description_log_event at the beginning of
|
||||||
@ -2239,7 +2235,7 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
set_read_error(info, error);
|
set_read_error(info, error);
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
event_type= (Log_event_type)((uchar)(*packet)[LOG_EVENT_OFFSET+ev_offset]);
|
event_type= (Log_event_type)((uchar)(*packet)[LOG_EVENT_OFFSET+ev_offset]);
|
||||||
@ -2260,7 +2256,7 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
sql_print_warning("Failed to find format descriptor event in "
|
sql_print_warning("Failed to find format descriptor event in "
|
||||||
"start of binlog: %s",
|
"start of binlog: %s",
|
||||||
info->log_file_name);
|
info->log_file_name);
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->current_checksum_alg= get_checksum_alg(packet->ptr() + ev_offset,
|
info->current_checksum_alg= get_checksum_alg(packet->ptr() + ev_offset,
|
||||||
@ -2280,7 +2276,7 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
sql_print_warning("Master is configured to log replication events "
|
sql_print_warning("Master is configured to log replication events "
|
||||||
"with checksum, but will not send such events to "
|
"with checksum, but will not send such events to "
|
||||||
"slaves that cannot process them");
|
"slaves that cannot process them");
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Format_description_log_event *tmp;
|
Format_description_log_event *tmp;
|
||||||
@ -2291,7 +2287,7 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
||||||
info->errmsg= "Corrupt Format_description event found "
|
info->errmsg= "Corrupt Format_description event found "
|
||||||
"or out-of-memory";
|
"or out-of-memory";
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
delete info->fdev;
|
delete info->fdev;
|
||||||
info->fdev= tmp;
|
info->fdev= tmp;
|
||||||
@ -2350,15 +2346,11 @@ static int send_format_descriptor_event(binlog_send_info *info,
|
|||||||
{
|
{
|
||||||
info->errmsg= "Failed on my_net_write()";
|
info->errmsg= "Failed on my_net_write()";
|
||||||
info->error= ER_UNKNOWN_ERROR;
|
info->error= ER_UNKNOWN_ERROR;
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** all done */
|
/** all done */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
} while (false);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool should_stop(binlog_send_info *info)
|
static bool should_stop(binlog_send_info *info)
|
||||||
@ -2545,9 +2537,7 @@ static my_off_t get_binlog_end_pos(binlog_send_info *info,
|
|||||||
* return 0 - OK
|
* return 0 - OK
|
||||||
* else NOK
|
* else NOK
|
||||||
*/
|
*/
|
||||||
static int send_events(binlog_send_info *info,
|
static int send_events(binlog_send_info *info, IO_CACHE* log, LOG_INFO* linfo,
|
||||||
IO_CACHE* log,
|
|
||||||
LOG_INFO* linfo,
|
|
||||||
my_off_t end_pos)
|
my_off_t end_pos)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
@ -2575,7 +2565,8 @@ static int send_events(binlog_send_info *info,
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
goto read_err;
|
set_read_error(info, error);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log_event_type event_type=
|
Log_event_type event_type=
|
||||||
@ -2661,11 +2652,6 @@ static int send_events(binlog_send_info *info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
read_err:
|
|
||||||
set_read_error(info, error);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user