@@ -663,21 +749,27 @@ static int dump_remote_log_entries(const char* logname)
...
@@ -663,21 +749,27 @@ static int dump_remote_log_entries(const char* logname)
charbuf[128];
charbuf[128];
charlast_db[FN_REFLEN+1]="";
charlast_db[FN_REFLEN+1]="";
uintlen,logname_len;
uintlen,logname_len;
NET*net=&mysql->net;
NET*net;
intold_format;
intold_format;
interror=0;
my_off_told_off=start_position_mot;
charfname[FN_REFLEN+1];
DBUG_ENTER("dump_remote_log_entries");
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);
old_format=check_master_version(mysql);
if(!position)
/*
position=BIN_LOG_HEADER_SIZE;// protect the innocent from spam
COM_BINLOG_DUMP accepts only 4 bytes for the position, so we are forced to
if(position<BIN_LOG_HEADER_SIZE)
cast to uint32.
{
*/
position=BIN_LOG_HEADER_SIZE;
int4store(buf,(uint32)start_position);
// 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);
int2store(buf+BIN_LOG_HEADER_SIZE,binlog_flags);
int2store(buf+BIN_LOG_HEADER_SIZE,binlog_flags);
logname_len=(uint)strlen(logname);
logname_len=(uint)strlen(logname);
int4store(buf+6,0);
int4store(buf+6,0);
...
@@ -685,33 +777,32 @@ static int dump_remote_log_entries(const char* logname)
...
@@ -685,33 +777,32 @@ static int dump_remote_log_entries(const char* logname)