summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache2.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-11-24 19:49:13 -0700
committerunknown <sasha@mysql.sashanet.com>2000-11-24 19:49:13 -0700
commit1ef81b2165e5bd416bcb5b6dc91d0cbb64e4af17 (patch)
tree8369a6e73770b40358d3b22b40c94e58de8913e4 /mysys/mf_iocache2.c
parent85a61b2cce24448f7ea24c75584a6f7061fd94e5 (diff)
downloadmariadb-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 'mysys/mf_iocache2.c')
-rw-r--r--mysys/mf_iocache2.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 1a8423981cb..f6e686e0378 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -27,14 +27,27 @@
/*
** Fix that next read will be made at certain position
-** This only works with READ_CACHE
+** For write cache, make next write happen at a certain position
*/
void my_b_seek(IO_CACHE *info,my_off_t pos)
{
- info->seek_not_done=1;
+ if(info->type == READ_CACHE)
+ {
+ info->rc_pos=info->rc_end=info->buffer;
+ }
+ else if(info->type == WRITE_CACHE)
+ {
+ byte* try_rc_pos;
+ try_rc_pos = info->rc_pos + (pos - info->pos_in_file);
+ if(try_rc_pos >= info->buffer && try_rc_pos <= info->rc_end)
+ info->rc_pos = try_rc_pos;
+ else
+ flush_io_cache(info);
+ }
+
info->pos_in_file=pos;
- info->rc_pos=info->rc_end=info->buffer;
+ info->seek_not_done=1;
}
/*
@@ -139,8 +152,6 @@ uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
{
- reg1 char *to= info->rc_pos;
- char *end=info->rc_end;
uint out_length=0;
for (; *fmt ; fmt++)
@@ -188,7 +199,8 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
if (my_b_write(info, buff, length))
goto err;
}
- else if (*fmt == 'l' && fmt[1] == 'd' || fmt[1] == 'u')/* long parameter */
+ else if ((*fmt == 'l' && fmt[1] == 'd') || fmt[1] == 'u')
+ /* long parameter */
{
register long iarg;
uint length;