Below is the list of changes that have just been committed into a local
4.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2066 05/03/02 18:14:58 jimw@stripped +3 -0
Avoid calls to my_seek() and my_tell() on log files so that
non-seekable files like FIFOs can be used for logs other
than the binlog. (Bug #8271)
sql/mysqld.cc
1.523 05/03/02 18:14:57 jimw@stripped +1 -1
Use APPEND_CACHE for log files not set to SEQ_READ_APPEND.
mysys/mf_iocache.c
1.41 05/03/02 18:14:57 jimw@stripped +12 -4
Handle APPEND_CACHE cache type to avoid calling my_seek() and my_tell()
on logs opened O_APPEND that we never read from (so they can be a
non-seekable file like a FIFO).
include/my_sys.h
1.111 05/03/02 18:14:57 jimw@stripped +1 -0
Add APPEND_CACHE cache type
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-4.0-8271
--- 1.110/include/my_sys.h 2005-01-14 17:47:03 -08:00
+++ 1.111/include/my_sys.h 2005-03-02 18:14:57 -08:00
@@ -270,6 +270,7 @@
enum cache_type
{
READ_CACHE,WRITE_CACHE,
+ APPEND_CACHE, /* Like WRITE_CACHE, but only append */
SEQ_READ_APPEND /* sequential read or append */,
READ_FIFO, READ_NET,WRITE_NET};
--- 1.40/mysys/mf_iocache.c 2005-01-14 17:47:03 -08:00
+++ 1.41/mysys/mf_iocache.c 2005-03-02 18:14:57 -08:00
@@ -88,7 +88,7 @@
void setup_io_cache(IO_CACHE* info)
{
/* Ensure that my_b_tell() and my_b_bytes_in_cache works */
- if (info->type == WRITE_CACHE)
+ if (info->type == WRITE_CACHE || info->type == APPEND_CACHE)
{
info->current_pos= &info->write_pos;
info->current_end= &info->write_end;
@@ -223,7 +223,7 @@
#endif
}
- if (type == WRITE_CACHE)
+ if (type == WRITE_CACHE || type == APPEND_CACHE)
info->write_end=
info->buffer+info->buffer_length- (seek_offset & (IO_SIZE-1));
else
@@ -293,6 +293,7 @@
/* One can't do reinit with the following types */
DBUG_ASSERT(type != READ_NET && info->type != READ_NET &&
type != WRITE_NET && info->type != WRITE_NET &&
+ type != APPEND_CACHE && info->type != APPEND_CACHE &&
type != SEQ_READ_APPEND && info->type != SEQ_READ_APPEND);
/* If the whole file is in memory, avoid flushing to disk */
@@ -1098,7 +1099,8 @@
my_off_t pos_in_file;
DBUG_ENTER("my_b_flush_io_cache");
- if (!(append_cache = (info->type == SEQ_READ_APPEND)))
+ if (!(append_cache = (info->type == SEQ_READ_APPEND ||
+ info->type == APPEND_CACHE)))
need_append_buffer_lock=0;
if (info->type == WRITE_CACHE || append_cache)
@@ -1145,7 +1147,13 @@
else
{
info->end_of_file+=(info->write_pos-info->append_read_pos);
- DBUG_ASSERT(info->end_of_file == my_tell(info->file,MYF(0)));
+ /*
+ We only need to worry that info->end_of_file is really accurate
+ for SEQ_READ_APPEND. For APPEND_CACHE, it is possible that the
+ file is non-seekable, like a FIFO.
+ */
+ DBUG_ASSERT(info->type != SEQ_READ_APPEND ||
+ info->end_of_file == my_tell(info->file,MYF(0)));
}
info->append_read_pos=info->write_pos=info->write_buffer;
--- 1.522/sql/mysqld.cc 2005-01-25 06:27:06 -08:00
+++ 1.523/sql/mysqld.cc 2005-03-02 18:14:57 -08:00
@@ -2198,7 +2198,7 @@
opt_name=tmp;
}
return log->open(opt_name, type, 0, index_file_name,
- (read_append) ? SEQ_READ_APPEND : WRITE_CACHE,
+ (read_append) ? SEQ_READ_APPEND : APPEND_CACHE,
no_auto_events, max_size);
}
| Thread |
|---|
| • bk commit into 4.0 tree (jimw:1.2066) BUG#8271 | Jim Winstead | 3 Mar |