summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache2.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2002-01-19 22:46:25 -0700
committerunknown <sasha@mysql.sashanet.com>2002-01-19 22:46:25 -0700
commit78fc1ed4bda14ca6e34aa55c4ad100a3020b5914 (patch)
tree254bb1b067e503a819145fff488d83709bf9c798 /mysys/mf_iocache2.c
parenta59f121fa9c29246460a555f6d0a09f5bbd55f0f (diff)
parent6291b7b591b0d5239dfac890209fe30dfc3dc8f5 (diff)
downloadmariadb-git-78fc1ed4bda14ca6e34aa55c4ad100a3020b5914.tar.gz
Ugly merge! But I am not done yet - there are a number of things I need to fix
before I can push BitKeeper/etc/ignore: auto-union Makefile.am: Auto merged include/my_sys.h: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/t/rpl_log.test: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_iocache2.c: Auto merged mysys/thr_mutex.c: Auto merged sql/item_func.cc: Auto merged sql/lex.h: Auto merged sql/mini_client.cc: Auto merged sql/mini_client.h: Auto merged sql/mysql_priv.h: Auto merged sql/repl_failsafe.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_show.cc: Auto merged sql/stacktrace.c: Auto merged sql/structs.h: Auto merged mysql-test/r/rpl000014.result: merge mysql-test/r/rpl000015.result: merge mysql-test/r/rpl000016.result: merge mysql-test/r/rpl_log.result: merge sql/log.cc: merge sql/log_event.cc: merge sql/log_event.h: merge sql/mysqld.cc: merge sql/slave.cc: merge sql/slave.h: merge sql/sql_class.h: merge sql/sql_parse.cc: merge sql/sql_repl.cc: merge sql/sql_yacc.yy: merge
Diffstat (limited to 'mysys/mf_iocache2.c')
-rw-r--r--mysys/mf_iocache2.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index c076b53e6a9..ca9c9938cd2 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -31,12 +31,26 @@
void my_b_seek(IO_CACHE *info,my_off_t pos)
{
- my_off_t offset = (pos - info->pos_in_file);
+ my_off_t offset;
DBUG_ENTER("my_b_seek");
DBUG_PRINT("enter",("pos: %lu", (ulong) pos));
- if (info->type == READ_CACHE)
+ /*
+ TODO: verify that it is OK to do seek in the non-append
+ area in SEQ_READ_APPEND cache
+ */
+ /* TODO:
+ a) see if this always works
+ b) see if there is a better way to make it work
+ */
+ if (info->type == SEQ_READ_APPEND)
+ flush_io_cache(info);
+
+ offset=(pos - info->pos_in_file);
+
+ if (info->type == READ_CACHE || info->type == SEQ_READ_APPEND)
{
+ /* TODO: explain why this works if pos < info->pos_in_file */
if ((ulonglong) offset < (ulonglong) (info->read_end - info->buffer))
{
/* The read is in the current buffer; Reuse it */