summaryrefslogtreecommitdiff
path: root/isam
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2003-08-02 02:43:18 -0700
committerunknown <igor@rurik.mysql.com>2003-08-02 02:43:18 -0700
commitb6d27e20e19e1998b745a438dbde635261ebc5d4 (patch)
treeadd5cbee3049a38799b03ee640b5ae06fbc34ef1 /isam
parent4f6f7f7ded18764b8aa382c3a84261657fea66f8 (diff)
downloadmariadb-git-b6d27e20e19e1998b745a438dbde635261ebc5d4.tar.gz
Many files:
Added key cache assignment mi_locking.c: Added key cache assignment: correction my_sys.h: Added key cache variable structure include/my_sys.h: Added key cache variable structure include/my_base.h: Added key cache assignment include/myisam.h: Added key cache assignment include/my_global.h: Added key cache assignment isam/_page.c: Added key cache assignment isam/close.c: Added key cache assignment isam/isamchk.c: Added key cache assignment isam/isamlog.c: Added key cache assignment isam/panic.c: Added key cache assignment isam/_locking.c: Added key cache assignment isam/test2.c: Added key cache assignment isam/test3.c: Added key cache assignment myisam/myisamdef.h: Added key cache assignment myisam/mi_check.c: Added key cache assignment myisam/mi_close.c: Added key cache assignment myisam/mi_extra.c: Added key cache assignment myisam/mi_page.c: Added key cache assignment myisam/mi_panic.c: Added key cache assignment myisam/mi_preload.c: Added key cache assignment myisam/mi_test1.c: Added key cache assignment myisam/mi_test2.c: Added key cache assignment myisam/mi_test3.c: Added key cache assignment myisam/myisamchk.c: Added key cache assignment myisam/myisamlog.c: Added key cache assignment myisam/mi_delete_all.c: Added key cache assignment myisam/mi_locking.c: Added key cache assignment: correction myisam/mi_keycache.c: Added key cache assignment sql/handler.h: Added key cache assignment sql/mysql_priv.h: Added key cache assignment sql/set_var.h: Added key cache assignment sql/table.h: Added key cache assignment sql/ha_myisam.cc: Added key cache assignment sql/ha_myisammrg.cc: Added key cache assignment sql/handler.cc: Added key cache assignment sql/mysqld.cc: Added key cache assignment sql/set_var.cc: Added key cache assignment sql/sql_base.cc: Added key cache assignment sql/sql_table.cc: Added key cache assignment sql/sql_test.cc: Added key cache assignment sql/sql_yacc.yy: Added key cache assignment mysys/mf_keycache.c: Added key cache assignment mysql-test/t/key_cache.test: Added key cache assignment mysql-test/r/key_cache.result: Added key cache assignment
Diffstat (limited to 'isam')
-rw-r--r--isam/_locking.c4
-rw-r--r--isam/_page.c8
-rw-r--r--isam/close.c2
-rw-r--r--isam/isamchk.c12
-rw-r--r--isam/isamlog.c8
-rw-r--r--isam/panic.c2
-rw-r--r--isam/test2.c2
-rw-r--r--isam/test3.c2
8 files changed, 21 insertions, 19 deletions
diff --git a/isam/_locking.c b/isam/_locking.c
index 3964f7e8ddf..0ffb46a81f8 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(dflt_keycache,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(dflt_keycache,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 fc150cf14bd..1a9719b53cc 100644
--- a/isam/_page.c
+++ b/isam/_page.c
@@ -27,7 +27,7 @@ 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(dflt_keycache,
+ tmp=(uchar*) key_cache_read(*dflt_keycache,
info->s->kfile,page,(byte*) buff,
(uint) keyinfo->base.block_length,
(uint) keyinfo->base.block_length,
@@ -84,7 +84,7 @@ int _nisam_write_keypage(register N_INFO *info, register N_KEYDEF *keyinfo,
length=keyinfo->base.block_length;
}
#endif
- return (key_cache_write(dflt_keycache,
+ return (key_cache_write(*dflt_keycache,
info->s->kfile,page,(byte*) buff,length,
(uint) keyinfo->base.block_length,
(int) (info->lock_type != F_UNLCK)));
@@ -101,7 +101,7 @@ 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(dflt_keycache,
+ DBUG_RETURN(key_cache_write(*dflt_keycache,
info->s->kfile,pos,(byte*) &old_link,
sizeof(long),
(uint) keyinfo->base.block_length,
@@ -129,7 +129,7 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo)
}
else
{
- if (!key_cache_read(dflt_keycache,
+ if (!key_cache_read(*dflt_keycache,
info->s->kfile,pos,
(byte*) &info->s->state.key_del[keynr],
(uint) sizeof(long),
diff --git a/isam/close.c b/isam/close.c
index 075d67d60f5..37b35e450ae 100644
--- a/isam/close.c
+++ b/isam/close.c
@@ -57,7 +57,7 @@ int nisam_close(register N_INFO *info)
if (flag)
{
if (share->kfile >= 0 &&
- flush_key_blocks(dflt_keycache,share->kfile,FLUSH_RELEASE))
+ 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 d3db440bf87..653d932c79d 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -516,8 +516,8 @@ static int nisamchk(my_string filename)
if (!rep_quick)
{
if (testflag & T_EXTEND)
- VOID(init_key_cache(&dflt_keycache,dflt_key_block_size,
- use_buffers));
+ VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,
+ use_buffers,&dflt_key_cache_var));
VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,
MYF(MY_WME)));
@@ -1460,7 +1460,8 @@ my_string name;
printf("Data records: %lu\n",(ulong) share->state.records);
}
- VOID(init_key_cache(&dflt_keycache,dflt_key_block_size,use_buffers));
+ VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
+ &dflt_key_cache_var));
if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
goto err;
@@ -1893,7 +1894,7 @@ File file;
print_error("%d when trying to write bufferts",my_errno);
return(1);
}
- end_key_cache(&dflt_keycache,1);
+ end_key_cache(dflt_keycache,1);
return 0;
} /* flush_blocks */
@@ -1937,7 +1938,8 @@ int write_info;
if (share->state.key_root[sort_key] == NI_POS_ERROR)
DBUG_RETURN(0); /* Nothing to do */
- init_key_cache(&dflt_keycache,dflt_key_block_size,use_buffers);
+ init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
+ &dflt_key_cache_var);
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/isamlog.c b/isam/isamlog.c
index ff3bca39e40..d8ea9d4ed80 100644
--- a/isam/isamlog.c
+++ b/isam/isamlog.c
@@ -329,8 +329,8 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
- VOID(init_key_cache(KEY_CACHE_SIZE));
-
+ VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
+ &dflt_key_cache_var));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
!my_b_read(&cache,(byte*) head,9))
@@ -622,7 +622,7 @@ static int examine_log(my_string file_name, char **table_names)
goto end;
}
}
- end_key_cache();
+ end_key_cache(dflt_keycache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
@@ -642,7 +642,7 @@ static int examine_log(my_string file_name, char **table_names)
llstr(isamlog_filepos,llbuff)));
fflush(stderr);
end:
- end_key_cache();
+ end_key_cache(dflt_keycache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
diff --git a/isam/panic.c b/isam/panic.c
index 53e8762afd3..de765f50e62 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(dflt_keycache,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 68d2ee7a82a..541f4a39a29 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(&dflt_keycache,dflt_key_block_size,IO_SIZE*16); /* Use a small cache */
+ init_key_cache(dflt_keycache,512,IO_SIZE*16,0); /* Use a small cache */
if (locking)
nisam_lock_database(file,F_WRLCK);
if (write_cacheing)
diff --git a/isam/test3.c b/isam/test3.c
index b753b6d4dac..1b867ba0348 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(&dflt_keycache,dflt_key_block_size,65536L);
+ init_key_cache(dflt_keycache,512,65536L,0);
printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)