sql/sql_repl.cc

    last fix in send_file() was wrong
parent c8a91588
...@@ -34,7 +34,7 @@ static int send_file(THD *thd) ...@@ -34,7 +34,7 @@ static int send_file(THD *thd)
char fname[FN_REFLEN+1]; char fname[FN_REFLEN+1];
char *buf; char *buf;
const char *errmsg = 0; const char *errmsg = 0;
int old_timeout,fname_len; int old_timeout,packet_len;
DBUG_ENTER("send_file"); DBUG_ENTER("send_file");
// the client might be slow loading the data, give him wait_timeout to do // the client might be slow loading the data, give him wait_timeout to do
...@@ -51,13 +51,13 @@ static int send_file(THD *thd) ...@@ -51,13 +51,13 @@ static int send_file(THD *thd)
// we need net_flush here because the client will not know it needs to send // we need net_flush here because the client will not know it needs to send
// us the file name until it has processed the load event entry // us the file name until it has processed the load event entry
if (net_flush(net) || (fname_len = my_net_read(net)) == packet_error) if (net_flush(net) || (packet_len = my_net_read(net)) == packet_error)
{ {
errmsg = "Failed reading file name"; errmsg = "Failed reading file name";
goto err; goto err;
} }
*((char*)net->read_pos + 1 + fname_len) = 0; // terminate with \0 *((char*)net->read_pos + packet_len) = 0; // terminate with \0
//for fn_format //for fn_format
fn_format(fname, (char*)net->read_pos + 1, "", "", 4); fn_format(fname, (char*)net->read_pos + 1, "", "", 4);
// this is needed to make replicate-ignore-db // this is needed to make replicate-ignore-db
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment