diff options
author | unknown <sasha@mysql.sashanet.com> | 2000-11-24 19:49:13 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2000-11-24 19:49:13 -0700 |
commit | 1ef81b2165e5bd416bcb5b6dc91d0cbb64e4af17 (patch) | |
tree | 8369a6e73770b40358d3b22b40c94e58de8913e4 /sql/sql_repl.cc | |
parent | 85a61b2cce24448f7ea24c75584a6f7061fd94e5 (diff) | |
download | mariadb-git-1ef81b2165e5bd416bcb5b6dc91d0cbb64e4af17.tar.gz |
slave master.info FILE -> IO_CACHE
send_file() is more stack-friendly - changed large static buffer to alloc_root()
fixed my_b_seek() to work with WRITE_CACHE
test case to make sure the slave starts correctly after being stopped
truncated words file so the replication tests will take less time
mysql-test/r/3.23/rpl000001.b.result:
truncated words file
mysql-test/r/3.23/rpl000004.b.result:
truncated words file
mysql-test/std_data/words:
truncated words file
BitKeeper/etc/ignore:
Added mysql-test/rpl000011.test mysql-test/var/lib/mysql-bin.007 sql/share/norwegian/errmsg.sys sql/share/norwegian-ny/errmsg.sys to the ignore list
mysys/mf_iocache2.c:
got my_b_seek() to work with WRITE_CACHE, at least the one used by the slave
sql/share/romanian/errmsg.sys:
accidently touched the file
sql/slave.cc:
converted FILE to IO_CACHE for master.info
sql/slave.h:
FILE -> IO_CACHE for master.info
sql/sql_repl.cc:
be nice to the stack - change a large stack buffer to be alloced with
alloc_root in send_file()
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 963fde93f2d..e0f98b9e0bd 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -32,7 +32,7 @@ static int send_file(THD *thd) NET* net = &thd->net; int fd = -1,bytes, error = 1; char fname[FN_REFLEN+1]; - char buf[IO_SIZE*15]; + char *buf; const char *errmsg = 0; int old_timeout; DBUG_ENTER("send_file"); @@ -42,6 +42,13 @@ static int send_file(THD *thd) old_timeout = thd->net.timeout; thd->net.timeout = thd->inactive_timeout; + // spare the stack + if(!(buf = alloc_root(&thd->mem_root,IO_SIZE))) + { + errmsg = "Out of memory"; + goto err; + } + // 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) @@ -62,7 +69,7 @@ static int send_file(THD *thd) goto err; } - while ((bytes = (int) my_read(fd, (byte*) buf, sizeof(buf), + while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(MY_WME))) > 0) { if (my_net_write(net, buf, bytes)) |