summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index c115ac5f0ec..2a22810b8c2 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2205,6 +2205,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
THD *thd= info->thd;
String *packet= info->packet;
Log_event_type event_type;
+ DBUG_ENTER("send_format_descriptor_event");
/**
* 1) reset fdev before each log-file
@@ -2219,12 +2220,12 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
{
info->errmsg= "Out of memory initializing format_description event";
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
- return 1;
+ DBUG_RETURN(1);
}
/* reset transmit packet for the event read from binary log file */
if (reset_transmit_packet(info, info->flags, &ev_offset, &info->errmsg))
- return 1;
+ DBUG_RETURN(1);
/*
Try to find a Format_description_log_event at the beginning of
@@ -2240,7 +2241,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
if (error)
{
set_read_error(info, error);
- return 1;
+ DBUG_RETURN(1);
}
event_type= (Log_event_type)((uchar)(*packet)[LOG_EVENT_OFFSET+ev_offset]);
@@ -2261,7 +2262,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
sql_print_warning("Failed to find format descriptor event in "
"start of binlog: %s",
info->log_file_name);
- return 1;
+ DBUG_RETURN(1);
}
info->current_checksum_alg= get_checksum_alg(packet->ptr() + ev_offset,
@@ -2281,7 +2282,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
sql_print_warning("Master is configured to log replication events "
"with checksum, but will not send such events to "
"slaves that cannot process them");
- return 1;
+ DBUG_RETURN(1);
}
uint ev_len= packet->length() - ev_offset;
@@ -2295,7 +2296,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
info->errmsg= "Corrupt Format_description event found "
"or out-of-memory";
- return 1;
+ DBUG_RETURN(1);
}
delete info->fdev;
info->fdev= tmp;
@@ -2354,7 +2355,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
{
info->errmsg= "Failed on my_net_write()";
info->error= ER_UNKNOWN_ERROR;
- return 1;
+ DBUG_RETURN(1);
}
/*
@@ -2374,7 +2375,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
if (error)
{
set_read_error(info, error);
- return 1;
+ DBUG_RETURN(1);
}
event_type= (Log_event_type)((uchar)(*packet)[LOG_EVENT_OFFSET]);
@@ -2386,14 +2387,15 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
if (!sele)
{
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
- return 1;
+ DBUG_RETURN(1);
}
if (info->fdev->start_decryption(sele))
{
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
info->errmsg= "Could not decrypt binlog: encryption key error";
- return 1;
+ delete sele;
+ DBUG_RETURN(1);
}
delete sele;
}
@@ -2409,7 +2411,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
/** all done */
- return 0;
+ DBUG_RETURN(0);
}
static bool should_stop(binlog_send_info *info)