diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-11-07 16:17:40 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-11-07 16:17:40 -0700 |
commit | fa09f2cd7e74fc99d6699a7bcda60fc7135b6f0e (patch) | |
tree | 671a90572eef4a30c42fc8492c11b46e905f2e04 /include | |
parent | c76c0836e4f5606615b42a8049fd747f542324da (diff) | |
download | mariadb-git-fa09f2cd7e74fc99d6699a7bcda60fc7135b6f0e.tar.gz |
manager clean-up ( added pid-file and kill in mysql-test-run when things go wrong)
fixes for IO_CACHE
need to pull Monty's fixes - this is not final, will not be pushed
include/my_sys.h:
IO_CACHE fixes
mysql-test/mysql-test-run.sh:
manager clean-up
mysys/mf_iocache.c:
IO_CACHE fix
sql/mysqld.cc:
more debug messages
tools/mysqlmanager.c:
added pid-file
Diffstat (limited to 'include')
-rw-r--r-- | include/my_sys.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index 5174425006d..f9df265df0f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -311,13 +311,15 @@ typedef struct st_io_cache /* Used when cacheing files */ that will use a buffer allocated somewhere else */ - byte *append_buffer, *append_read_pos, *append_write_pos, *append_end; + byte *append_buffer, *append_read_pos, *write_pos, *append_end, + *write_end; /* for append buffer used in READ_APPEND cache */ #ifdef THREAD pthread_mutex_t append_buffer_lock; /* need mutex copying from append buffer to read buffer */ #endif int (*read_function)(struct st_io_cache *,byte *,uint); + int (*write_function)(struct st_io_cache *,const byte *,uint); /* callbacks when the actual read I/O happens */ IO_CACHE_CALLBACK pre_read; IO_CACHE_CALLBACK post_read; @@ -352,21 +354,19 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ((info)->rc_pos+=(Count)),0) :\ (*(info)->read_function)((info),Buffer,Count)) +#define my_b_write(info,Buffer,Count) \ + ((info)->write_pos + (Count) <=(info)->write_end ?\ + (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ + ((info)->write_pos+=(Count)),0) : \ + (*(info)->write_function)((info),(Buffer),(Count))) + + + #define my_b_get(info) \ ((info)->rc_pos != (info)->rc_end ?\ ((info)->rc_pos++, (int) (uchar) (info)->rc_pos[-1]) :\ _my_b_get(info)) -#define my_b_write(info,Buffer,Count) \ - ((info)->type != SEQ_READ_APPEND) ? (\ - ((info)->rc_pos + (Count) <= (info)->rc_end ?\ - (memcpy((info)->rc_pos,Buffer,(size_t) (Count)), \ - ((info)->rc_pos+=(Count)),0) :\ - _my_b_write(info,Buffer,Count))) : \ - ((info)->append_write_pos + (Count) <= (info)->append_end ?\ - (memcpy((info)->append_write_pos,Buffer,(size_t)Count), \ - ((info)->append_write_pos+=(Count),0)) : \ - _my_b_append(info,Buffer,Count)) /* my_b_write_byte dosn't have any err-check */ #define my_b_write_byte(info,chr) \ @@ -650,6 +650,7 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); ulong checksum(const byte *mem, uint count); uint my_bit_log2(ulong value); + #if defined(_MSC_VER) && !defined(__WIN__) extern void sleep(int sec); #endif @@ -662,3 +663,11 @@ extern my_bool have_tcpip; /* Is set if tcpip is used */ #endif #include "raid.h" #endif /* _my_sys_h */ + + + + + + + + |