summaryrefslogtreecommitdiff
path: root/isam
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-11-20 22:06:25 +0200
committerunknown <monty@mysql.com>2003-11-20 22:06:25 +0200
commit35da5e43fbd3653c39358669365e2c329e1e555c (patch)
tree685b3a2a60fc00121d338cb0b5f84b4cd028bfe1 /isam
parentf25cbdd9141004e6e9f0a7313d763c1cc1de36ec (diff)
downloadmariadb-git-35da5e43fbd3653c39358669365e2c329e1e555c.tar.gz
Merge key cache structures to one
Fixed compiler warnings (IRIX C compiler and VC++) VC++Files/client/mysqlclient.dsp: Add missing file to project VC++Files/libmysql/libmysql.dsp: Add missing file to project VC++Files/myisam/myisam.dsp: Add missing file to project VC++Files/mysys/mysys.dsp: Add missing file to project heap/hp_test1.c: Fixed wrong call to heap_rkey() heap/hp_test2.c: Fixed wrong call to heap_rkey() include/hash.h: Move not used (internal) struct to hash.c include/my_pthread.h: Made some structs 'const char*' to avoid warnings include/my_sys.h: Moved key cache structs and functions to keycache.h include/myisam.h: Merge key cache structures to one include/mysql.h: Remove STDCALL from internal functions include/sql_common.h: Remove STDCALL from internal functions include/violite.h: Fixed compiler warning isam/_locking.c: Merge key cache structures to one isam/_page.c: Merge key cache structures to one isam/close.c: Merge key cache structures to one isam/extra.c: Merge key cache structures to one isam/isamchk.c: Merge key cache structures to one isam/isamdef.h: Merge key cache structures to one isam/isamlog.c: Merge key cache structures to one isam/panic.c: Merge key cache structures to one isam/test2.c: Merge key cache structures to one isam/test3.c: Merge key cache structures to one libmysql/client_settings.h: Remove STDCALL from internal functions libmysql/libmysql.c: Remove STDCALL from internal functions myisam/ft_boolean_search.c: Fixed compiler warning myisam/ft_dump.c: Fixed compiler warnings (%qx is not portable) myisam/ft_update.c: Fixed compiler warnings myisam/mi_check.c: Merge key cache structures to one myisam/mi_close.c: Merge key cache structures to one myisam/mi_delete_all.c: Merge key cache structures to one myisam/mi_extra.c: Merge key cache structures to one myisam/mi_keycache.c: Merge key cache structures to one myisam/mi_locking.c: Merge key cache structures to one myisam/mi_page.c: Merge key cache structures to one myisam/mi_panic.c: Merge key cache structures to one myisam/mi_preload.c: Merge key cache structures to one myisam/mi_test1.c: Merge key cache structures to one myisam/mi_test2.c: Merge key cache structures to one myisam/mi_test3.c: Merge key cache structures to one myisam/myisamchk.c: Merge key cache structures to one myisam/myisamdef.h: Merge key cache structures to one myisam/myisamlog.c: Merge key cache structures to one Removed not used option myisam/sort.c: Fixed compiler warnings myisam/sp_test.c: Fixed compiler warnings mysql-test/r/case.result: Updated results after fix of correct NULL detection in WHEN mysql-test/r/date_formats.result: Updated results after fixing date handling mysql-test/r/symlink.result: Updated results after adding DEFAULT CHARSET mysql-test/t/case.test: New test mysql-test/t/symlink.test: Updated error numbers mysys/hash.c: Made HASH_LINK struct local mysys/mf_keycache.c: Merge key cache structures to one Fixed key_cache_read() and key_cache_write() to be resize-safe. mysys/mf_keycaches.c: Merge key cache structures to one mysys/thr_mutex.c: Added test if mutex is initalized sql-common/client.c: Remove STDCALL from internal functions sql/derror.cc: Added comment sql/field.cc: Removed not used variables sql/ha_innodb.cc: Fixed compiler warnings (removed not used variables) sql/ha_myisam.cc: Merge key cache structures to one sql/ha_myisammrg.cc: Removed not used variables sql/handler.cc: Merge key cache structures to one sql/handler.h: Merge key cache structures to one sql/item.cc: Fixed compiler warning sql/item_cmpfunc.cc: Remove not used variables sql/item_func.cc: Remove not used variables sql/item_strfunc.cc: Removed not used variables sql/item_sum.cc: Removed not used variables Moved setting of item_thd to fix_fields() sql/item_timefunc.cc: Removed not used variables sql/mysql_priv.h: Merge key cache structures to one sql/mysqld.cc: Merge key cache structures to one init_thread_environment() is not called before mysql_init_variables(). This fixes a case where a mutex was not initialized before it was used sql/opt_sum.cc: Remove not used variables sql/protocol.cc: Don't send errors after ok has been sent sql/protocol_cursor.cc: Remove not used variable Simple optimization sql/repl_failsafe.cc: Remove not used variables sql/set_var.cc: Merge key cache structures to one sql/set_var.h: Merge key cache structures to one sql/sql_acl.cc: Remove not used variables sql/sql_base.cc: Remove not used function sql/sql_db.cc: Remove not used variables sql/sql_handler.cc: Remove not used variables sql/sql_insert.cc: More DBUG statements Simple code cleanup sql/sql_lex.cc: Remove not used variables sql/sql_parse.cc: Remove not used variables sql/sql_prepare.cc: Remove not used variables sql/sql_repl.cc: Remove not used variables sql/sql_select.cc: Remove not used variables sql/sql_show.cc: Remove not used variables sql/sql_table.cc: Merge key cache structures to one Removed not used variables sql/sql_test.cc: Merge key cache structures to one sql/strfunc.cc: Fixed that find_type() returns correct value for partly matched words. (This fixed the error found by date_formats.test) sql/time.cc: Remove not used variables strings/my_strtoll10.c: Fixed compiler warnings
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/extra.c2
-rw-r--r--isam/isamchk.c14
-rw-r--r--isam/isamdef.h1
-rw-r--r--isam/isamlog.c8
-rw-r--r--isam/panic.c2
-rw-r--r--isam/test2.c4
-rw-r--r--isam/test3.c3
10 files changed, 24 insertions, 24 deletions
diff --git a/isam/_locking.c b/isam/_locking.c
index 0ffb46a81f8..e19804549e5 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_key_cache,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_key_cache,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 60f1dfb0ce6..e31115e624f 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_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,(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_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,
(byte*) buff,length,
(uint) keyinfo->base.block_length,
@@ -102,7 +102,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_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &old_link,
sizeof(long),
@@ -131,7 +131,7 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo)
}
else
{
- if (!key_cache_read(*dflt_keycache,
+ if (!key_cache_read(dflt_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &info->s->state.key_del[keynr],
(uint) sizeof(long),
diff --git a/isam/close.c b/isam/close.c
index 37b35e450ae..37425653a5d 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_key_cache,share->kfile,FLUSH_RELEASE))
error=my_errno;
if (share->kfile >= 0 && my_close(share->kfile,MYF(0)))
error = my_errno;
diff --git a/isam/extra.c b/isam/extra.c
index 3bf1dd012ed..421404311c8 100644
--- a/isam/extra.c
+++ b/isam/extra.c
@@ -215,7 +215,7 @@ int nisam_extra(N_INFO *info, enum ha_extra_function function)
info->s->last_version= 0L; /* Impossible version */
#ifdef __WIN__
/* Close the isam and data files as Win32 can't drop an open table */
- if (flush_key_blocks(info->s->kfile,FLUSH_RELEASE))
+ if (flush_key_blocks(dflt_key_cache, info->s->kfile, FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
diff --git a/isam/isamchk.c b/isam/isamchk.c
index e59da07e85b..0c0df603da0 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,KEY_CACHE_BLOCK_SIZE,
- use_buffers,&dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,
+ use_buffers,0,0));
VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,
MYF(MY_WME)));
@@ -1460,8 +1460,7 @@ my_string name;
printf("Data records: %lu\n",(ulong) share->state.records);
}
- VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
- &dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers,0,0));
if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
goto err;
@@ -1889,12 +1888,12 @@ static void lock_memory(void)
static int flush_blocks(file)
File file;
{
- if (flush_key_blocks(dflt_keycache,file,FLUSH_RELEASE))
+ if (flush_key_blocks(dflt_key_cache,file,FLUSH_RELEASE))
{
print_error("%d when trying to write bufferts",my_errno);
return(1);
}
- end_key_cache(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,1);
return 0;
} /* flush_blocks */
@@ -1938,8 +1937,7 @@ int write_info;
if (share->state.key_root[sort_key] == NI_POS_ERROR)
DBUG_RETURN(0); /* Nothing to do */
- init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
- &dflt_key_cache_var);
+ init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers, 0, 0);
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/isamdef.h b/isam/isamdef.h
index 54656b6842e..7d89730fe32 100644
--- a/isam/isamdef.h
+++ b/isam/isamdef.h
@@ -24,6 +24,7 @@
#else
#include <my_no_pthread.h>
#endif
+#include <keycache.h>
#ifdef my_write
#undef my_write /* We want test if disk full */
diff --git a/isam/isamlog.c b/isam/isamlog.c
index d8ea9d4ed80..75a35ef9704 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(dflt_keycache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
- &dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
+ 0,0));
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(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,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(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,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 de765f50e62..7af979a5104 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_key_cache,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 67b411d1bbf..14a40f39865 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,512,IO_SIZE*16,0); /* Use a small cache */
+ init_key_cache(dflt_key_cache,512,IO_SIZE*16,0,0); /* 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(&dflt_keycache,1);
+ end_key_cache(dflt_key_cache,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 1b867ba0348..9195fcbf1b6 100644
--- a/isam/test3.c
+++ b/isam/test3.c
@@ -20,6 +20,7 @@
#include "nisam.h"
#include <sys/types.h>
+#include <keycache.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
@@ -173,7 +174,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
- init_key_cache(dflt_keycache,512,65536L,0);
+ init_key_cache(dflt_key_cache,512,65536L,0,0);
printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)