summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-12-11 12:06:34 -0700
committerunknown <sasha@mysql.sashanet.com>2000-12-11 12:06:34 -0700
commit7429b2e1e830911fe73b37aa3c201e6774114c34 (patch)
tree06aa933eac99f585851460d08dbc8105cd1e456b /sql/sql_repl.cc
parent5d6b2d0d3515d1ffc293ddaf83b875742e4cca09 (diff)
downloadmariadb-git-7429b2e1e830911fe73b37aa3c201e6774114c34.tar.gz
I hope I've fixed all the bugs by now, let's test it
sql/log_event.h: changed new/delete for Log_event to use my_malloc/my_free sql/mysql_priv.h: wait for slave to get going sql/mysqld.cc: wait for slave to get going in SLAVE START sql/slave.cc: fixed more memory leaks sql/sql_repl.cc: file name was not being \0 terminated in send_file
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 6dd9d805183..27523a18481 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -34,7 +34,7 @@ static int send_file(THD *thd)
char fname[FN_REFLEN+1];
char *buf;
const char *errmsg = 0;
- int old_timeout;
+ int old_timeout,fname_len;
DBUG_ENTER("send_file");
// the client might be slow loading the data, give him wait_timeout to do
@@ -51,12 +51,14 @@ static int send_file(THD *thd)
// 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
- if (net_flush(net) || my_net_read(net) == packet_error)
+ if (net_flush(net) || (fname_len = my_net_read(net)) == packet_error)
{
errmsg = "Failed reading file name";
goto err;
}
+ *((char*)net->read_pos + 1 + fname_len) = 0; // terminate with \0
+ //for fn_format
fn_format(fname, (char*)net->read_pos + 1, "", "", 4);
// this is needed to make replicate-ignore-db
if (!strcmp(fname,"/dev/null"))
@@ -513,6 +515,7 @@ int start_slave(THD* thd , bool net_report)
{
err = "cannot create slave thread";
}
+ pthread_cond_wait(&COND_slave_start, &LOCK_slave);
}
else
err = "Master host not set, or server id not configured";