@@ -663,21 +749,27 @@ static int dump_remote_log_entries(const char* logname)
charbuf[128];
charlast_db[FN_REFLEN+1]="";
uintlen,logname_len;
NET*net=&mysql->net;
NET*net;
intold_format;
interror=0;
my_off_told_off=start_position_mot;
charfname[FN_REFLEN+1];
DBUG_ENTER("dump_remote_log_entries");
/*
Even if we already read one binlog (case of >=2 binlogs on command line),
we cannot re-use the same connection as before, because it is now dead
(COM_BINLOG_DUMP kills the thread when it finishes).
*/
mysql=safe_connect();
net=&mysql->net;
old_format=check_master_version(mysql);
if(!position)
position=BIN_LOG_HEADER_SIZE;// protect the innocent from spam
if(position<BIN_LOG_HEADER_SIZE)
{
position=BIN_LOG_HEADER_SIZE;
// warn the user
sql_print_error("Warning: The position in the binary log can't be less than %d.\nStarting from position %d\n",BIN_LOG_HEADER_SIZE,BIN_LOG_HEADER_SIZE);
}
int4store(buf,position);
/*
COM_BINLOG_DUMP accepts only 4 bytes for the position, so we are forced to
cast to uint32.
*/
int4store(buf,(uint32)start_position);
int2store(buf+BIN_LOG_HEADER_SIZE,binlog_flags);
logname_len=(uint)strlen(logname);
int4store(buf+6,0);
...
...
@@ -685,33 +777,32 @@ static int dump_remote_log_entries(const char* logname)