diff options
author | sasha@mysql.sashanet.com <> | 2000-11-24 19:49:13 -0700 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2000-11-24 19:49:13 -0700 |
commit | a9ef0b4bf11c25b64c38aee037a03f0875b9003c (patch) | |
tree | 8369a6e73770b40358d3b22b40c94e58de8913e4 /mysys/mf_iocache2.c | |
parent | 93ac0a2582d4e0e83f61002ae28825b5c722a722 (diff) | |
download | mariadb-git-a9ef0b4bf11c25b64c38aee037a03f0875b9003c.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
Diffstat (limited to 'mysys/mf_iocache2.c')
-rw-r--r-- | mysys/mf_iocache2.c | 24 |
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; |