diff options
author | unknown <igor@rurik.mysql.com> | 2003-06-30 09:41:41 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2003-06-30 09:41:41 -0700 |
commit | 80c1bba3a90e36dbcbc4ec35171f21508759e99b (patch) | |
tree | 44574656fb0c8810963e2afccae4c1d98fc12d0b /isam | |
parent | 0912871d6aeefe61dae1370ab9a1493341b9b4fc (diff) | |
download | mariadb-git-80c1bba3a90e36dbcbc4ec35171f21508759e99b.tar.gz |
Many files:
Added multiple key cache
myisam/mi_page.c:
Added multiple key cache
myisam/mi_delete_all.c:
Added multiple key cache
myisam/mi_extra.c:
Added multiple key cache
myisam/mi_locking.c:
Added multiple key cache
myisam/mi_panic.c:
Added multiple key cache
myisam/mi_preload.c:
Added multiple key cache
myisam/mi_check.c:
Added multiple key cache
myisam/myisamchk.c:
Added multiple key cache
myisam/myisamlog.c:
Added multiple key cache
myisam/mi_close.c:
Added multiple key cache
myisam/mi_test1.c:
Added multiple key cache
myisam/mi_test2.c:
Added multiple key cache
myisam/mi_test3.c:
Added multiple key cache
isam/_page.c:
Added multiple key cache
isam/_locking.c:
Added multiple key cache
isam/panic.c:
Added multiple key cache
isam/close.c:
Added multiple key cache
isam/isamchk.c:
Added multiple key cache
isam/test2.c:
Added multiple key cache
isam/test3.c:
Added multiple key cache
mysys/mf_keycache.c:
Added multiple key cache
include/my_sys.h:
Added multiple key cache
Diffstat (limited to 'isam')
-rw-r--r-- | isam/_locking.c | 4 | ||||
-rw-r--r-- | isam/_page.c | 22 | ||||
-rw-r--r-- | isam/close.c | 3 | ||||
-rw-r--r-- | isam/isamchk.c | 11 | ||||
-rw-r--r-- | isam/panic.c | 2 | ||||
-rw-r--r-- | isam/test2.c | 4 | ||||
-rw-r--r-- | isam/test3.c | 2 |
7 files changed, 27 insertions, 21 deletions
diff --git a/isam/_locking.c b/isam/_locking.c index be9741a4237..3964f7e8ddf 100644 --- a/isam/_locking.c +++ b/isam/_locking.c @@ -50,7 +50,7 @@ int nisam_lock_database(N_INFO *info, int lock_type) else count= --share->w_locks; if (info->lock_type == F_WRLCK && !share->w_locks && - flush_key_blocks(share->kfile,FLUSH_KEEP)) + flush_key_blocks(dflt_keycache,share->kfile,FLUSH_KEEP)) error=my_errno; if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) if (end_io_cache(&info->rec_cache)) @@ -329,7 +329,7 @@ int _nisam_test_if_changed(register N_INFO *info) share->state.uniq != info->last_uniq) { /* Keyfile has changed */ if (share->state.process != share->this_process) - VOID(flush_key_blocks(share->kfile,FLUSH_RELEASE)); + VOID(flush_key_blocks(dflt_keycache,share->kfile,FLUSH_RELEASE)); share->last_process=share->state.process; info->last_loop= share->state.loop; info->last_uniq= share->state.uniq; diff --git a/isam/_page.c b/isam/_page.c index 65733d66b77..fc150cf14bd 100644 --- a/isam/_page.c +++ b/isam/_page.c @@ -27,10 +27,11 @@ uchar *_nisam_fetch_keypage(register N_INFO *info, N_KEYDEF *keyinfo, my_off_t page, uchar *buff, int return_buffer) { uchar *tmp; - tmp=(uchar*) key_cache_read(info->s->kfile,page,(byte*) buff, - (uint) keyinfo->base.block_length, - (uint) keyinfo->base.block_length, - return_buffer); + tmp=(uchar*) key_cache_read(dflt_keycache, + info->s->kfile,page,(byte*) buff, + (uint) keyinfo->base.block_length, + (uint) keyinfo->base.block_length, + return_buffer); if (tmp == info->buff) { info->update|=HA_STATE_BUFF_SAVED; @@ -83,9 +84,10 @@ int _nisam_write_keypage(register N_INFO *info, register N_KEYDEF *keyinfo, length=keyinfo->base.block_length; } #endif - return (key_cache_write(info->s->kfile,page,(byte*) buff,length, - (uint) keyinfo->base.block_length, - (int) (info->lock_type != F_UNLCK))); + return (key_cache_write(dflt_keycache, + info->s->kfile,page,(byte*) buff,length, + (uint) keyinfo->base.block_length, + (int) (info->lock_type != F_UNLCK))); } /* nisam_write_keypage */ @@ -99,7 +101,8 @@ int _nisam_dispose(register N_INFO *info, N_KEYDEF *keyinfo, my_off_t pos) old_link=info->s->state.key_del[keynr]; info->s->state.key_del[keynr]=(ulong) pos; - DBUG_RETURN(key_cache_write(info->s->kfile,pos,(byte*) &old_link, + DBUG_RETURN(key_cache_write(dflt_keycache, + info->s->kfile,pos,(byte*) &old_link, sizeof(long), (uint) keyinfo->base.block_length, (int) (info->lock_type != F_UNLCK))); @@ -126,7 +129,8 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo) } else { - if (!key_cache_read(info->s->kfile,pos, + if (!key_cache_read(dflt_keycache, + info->s->kfile,pos, (byte*) &info->s->state.key_del[keynr], (uint) sizeof(long), (uint) keyinfo->base.block_length,0)) diff --git a/isam/close.c b/isam/close.c index f1465990100..075d67d60f5 100644 --- a/isam/close.c +++ b/isam/close.c @@ -56,7 +56,8 @@ int nisam_close(register N_INFO *info) if (flag) { - if (share->kfile >= 0 && flush_key_blocks(share->kfile,FLUSH_RELEASE)) + if (share->kfile >= 0 && + flush_key_blocks(dflt_keycache,share->kfile,FLUSH_RELEASE)) error=my_errno; if (share->kfile >= 0 && my_close(share->kfile,MYF(0))) error = my_errno; diff --git a/isam/isamchk.c b/isam/isamchk.c index dc772290e13..d3db440bf87 100644 --- a/isam/isamchk.c +++ b/isam/isamchk.c @@ -516,7 +516,8 @@ static int nisamchk(my_string filename) if (!rep_quick) { if (testflag & T_EXTEND) - VOID(init_key_cache(use_buffers)); + VOID(init_key_cache(&dflt_keycache,dflt_key_block_size, + use_buffers)); VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length, READ_CACHE,share->pack.header_length,1, MYF(MY_WME))); @@ -1459,7 +1460,7 @@ my_string name; printf("Data records: %lu\n",(ulong) share->state.records); } - VOID(init_key_cache(use_buffers)); + VOID(init_key_cache(&dflt_keycache,dflt_key_block_size,use_buffers)); if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length, READ_CACHE,share->pack.header_length,1,MYF(MY_WME))) goto err; @@ -1887,12 +1888,12 @@ static void lock_memory(void) static int flush_blocks(file) File file; { - if (flush_key_blocks(file,FLUSH_RELEASE)) + if (flush_key_blocks(dflt_keycache,file,FLUSH_RELEASE)) { print_error("%d when trying to write bufferts",my_errno); return(1); } - end_key_cache(); + end_key_cache(&dflt_keycache,1); return 0; } /* flush_blocks */ @@ -1936,7 +1937,7 @@ int write_info; if (share->state.key_root[sort_key] == NI_POS_ERROR) DBUG_RETURN(0); /* Nothing to do */ - init_key_cache(use_buffers); + init_key_cache(&dflt_keycache,dflt_key_block_size,use_buffers); if (init_io_cache(&info->rec_cache,-1,(uint) write_buffer_length, WRITE_CACHE,share->pack.header_length,1, MYF(MY_WME | MY_WAIT_IF_FULL))) diff --git a/isam/panic.c b/isam/panic.c index e51e83671df..53e8762afd3 100644 --- a/isam/panic.c +++ b/isam/panic.c @@ -48,7 +48,7 @@ int nisam_panic(enum ha_panic_function flag) if (info->s->base.options & HA_OPTION_READ_ONLY_DATA) break; #endif - if (flush_key_blocks(info->s->kfile,FLUSH_RELEASE)) + if (flush_key_blocks(dflt_keycache,info->s->kfile,FLUSH_RELEASE)) error=my_errno; if (info->opt_flag & WRITE_CACHE_USED) if (flush_io_cache(&info->rec_cache)) diff --git a/isam/test2.c b/isam/test2.c index c8f97ccdefa..68d2ee7a82a 100644 --- a/isam/test2.c +++ b/isam/test2.c @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) goto err; printf("- Writing key:s\n"); if (key_cacheing) - init_key_cache(IO_SIZE*16); /* Use a small cache */ + init_key_cache(&dflt_keycache,dflt_key_block_size,IO_SIZE*16); /* Use a small cache */ if (locking) nisam_lock_database(file,F_WRLCK); if (write_cacheing) @@ -674,7 +674,7 @@ end: puts("Locking used"); if (use_blob) puts("blobs used"); - end_key_cache(); + end_key_cache(&dflt_keycache,1); if (blob_buffer) my_free(blob_buffer,MYF(0)); my_end(MY_CHECK_ERROR | MY_GIVE_INFO); diff --git a/isam/test3.c b/isam/test3.c index 228030f5832..b753b6d4dac 100644 --- a/isam/test3.c +++ b/isam/test3.c @@ -173,7 +173,7 @@ void start_test(int id) exit(1); } if (key_cacheing && rnd(2) == 0) - init_key_cache(65536L); + init_key_cache(&dflt_keycache,dflt_key_block_size,65536L); printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout); for (error=i=0 ; i < tests && !error; i++) |