diff options
author | unknown <monty@mashka.mysql.fi> | 2002-07-23 18:31:22 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-07-23 18:31:22 +0300 |
commit | a8caad316a89d6eeb8c22e70bc7a5fd4cf6ce904 (patch) | |
tree | 2e458857fc65791ee553b4cde0e28ef9459050a5 /myisam | |
parent | 6b3e98d505297e6cbd0cbd22d4f46eacb091d924 (diff) | |
download | mariadb-git-a8caad316a89d6eeb8c22e70bc7a5fd4cf6ce904.tar.gz |
New SET syntax & system variables.
Made a some new buffers thread specific and changeable.
Resize of key_buffer.
AUTO_COMMIT -> AUTOCOMMIT
Fixed mutex bug in DROP DATABASE
Fixed bug when using auto_increment as second part of a key where first part could include NULL.
Split handler->extra() to extra() and extra_opt() to be able to support thread specific buffers.
Don't write message to error log when slave reconnects becasue of timeout.
Fixed possible update problem when using DELETE/UPDATE on small tables
(In some cases we used index even if table scanning would be better)
A lot of minior code cleanups
BitKeeper/deleted/.del-net.c~ef21d6402bb882f9:
Delete: libmysql/net.c
BitKeeper/etc/ignore:
added libmysql/net.c
Docs/manual.texi:
New SET syntax & system variables.
client/client_priv.h:
moved order of include files
client/mysql.cc:
Removed compiler warning
client/mysqladmin.c:
Use new SHOW GLOBAL syntax (if server supports it)
configure.in:
version change
include/Makefile.am:
indentation cleanup
include/my_getopt.h:
Made some helper functions global
include/my_sys.h:
Removed not used code
include/myisam.h:
Added extra argument to ..._extra()
include/myisammrg.h:
Added extra argument to ..._extra()
include/mysql_com.h:
changed NET to be able to support changeable system variables
include/mysql_embed.h:
Added MYSQL_SERVER_SUFFIX
include/mysql_version.h.in:
Added check of multiple including (needed for embedded library)
include/mysqld_error.h:
New error messages
innobase/dict/dict0dict.c:
Remove compiler warnings
innobase/include/ut0mem.h:
Remove compiler warnings
innobase/include/ut0mem.ic:
Remove compiler warnings
isam/isamchk.c:
new init_key_cache() arguments
isam/isamlog.c:
new init_key_cache() arguments
isam/test2.c:
new init_key_cache() arguments
isam/test3.c:
new init_key_cache() arguments
libmysql/Makefile.am:
Removed net.c (Automaticly make it from net_serv.cc)
libmysql/Makefile.shared:
Removed net.c (Automaticly make it from net_serv.cc)
libmysql/libmysql.c:
Changeable system variables
libmysqld/Makefile.am:
Added set_var.cc file
libmysqld/embedded_priv.h:
Changed order of include fiels
libmysqld/lib_sql.cc:
merge with mysqld.cc (for changeable variables)
libmysqld/libmysqld.c:
New changeable system variables
myisam/mi_check.c:
Added extra argument to ..._extra()
myisam/mi_extra.c:
Added extra argument to ..._extra()
myisam/mi_open.c:
Removed not used variable
myisam/mi_test1.c:
Changed call to init_key_cache
myisam/mi_test2.c:
Added extra argument to ..._extra()
myisam/mi_test3.c:
Added extra argument to ..._extra()
myisam/mi_write.c:
Add cache size argument to bulk-insert-init
myisam/myisamchk.c:
Use new key cache
myisam/myisamdef.h:
new mi_init_bulk_insert() arguments
myisam/myisamlog.c:
Added extra argument to ..._extra()
myisam/myisampack.c:
Added extra argument to ..._extra()
myisammrg/myrg_extra.c:
Added extra argument to ..._extra()
myisammrg/myrg_rrnd.c:
Added extra argument to ..._extra()
mysql-test/r/insert_select.result:
New changeable system variables
mysql-test/r/key.result:
Test of bug in auto_increment
mysql-test/r/query_cache.result:
New changeable system variables
mysql-test/r/rpl000001.result:
New changeable system variables
mysql-test/r/rpl000016.result:
New changeable system variables
mysql-test/r/union.result:
New changeable system variables
mysql-test/r/user_var.result:
New changeable system variables
mysql-test/r/variables.result:
New changeable system variables
mysql-test/t/key.test:
Test of bug in auto_increment
mysql-test/t/query_cache.test:
New changeable system variables
mysql-test/t/rpl000001.test:
New changeable system variables
mysql-test/t/rpl000009.test:
New changeable system variables
mysql-test/t/rpl000016.test:
New changeable system variables
mysql-test/t/rpl_compat.test:
New changeable system variables
mysql-test/t/union.test:
New changeable system variables
mysql-test/t/user_var.test:
New changeable system variables
mysql-test/t/variables.test:
New changeable system variables
mysys/default.c:
Bigger default memory allocation
mysys/mf_iocache.c:
Removed compiler warning
mysys/mf_keycache.c:
Made key cache resizable on the fly
Removed not needed extra argument to init_key_cache()
mysys/my_getopt.c:
Made some helper functions global
sql/Makefile.am:
Aded set_var.cc
sql/convert.cc:
Comment cleanup
sql/field.cc:
new changeable system variables
sql/filesort.cc:
new changeable system variables
sql/ha_berkeley.cc:
AUTO_COMMIT -> AUTOCOMMIT
sql/ha_innodb.cc:
new changeable system variables
sql/ha_myisam.cc:
Added extra argument to ..._extra()
sql/ha_myisam.h:
Added extra argument to ..._extra()
sql/ha_myisammrg.cc:
Added extra argument to ..._extra()
sql/ha_myisammrg.h:
Added extra argument to ..._extra()
sql/handler.cc:
Added extra argument to ..._extra()
Added resize of key cache
Change ha_table_typelib for use with new system variables
sql/handler.h:
Added extra argument to ..._extra()
sql/item.cc:
new changeable system variables
sql/item.h:
Added better support of Item_uint
sql/item_func.cc:
Added support for SET @@[global | session] system_variable
sql/item_strfunc.cc:
new changeable system variables
sql/key.cc:
Fixed bug in auto_increment on second part keys
sql/lex.h:
Removed not needed keywords
sql/log.cc:
new changeable system variables
sql/log_event.cc:
new changeable system variables
sql/log_event.h:
Removed not needed var reference
sql/mini_client.cc:
new changeable system variables
code cleanup
sql/mini_client.h:
Indentation cleanup
sql/mysql_priv.h:
Changed order of include files & variables to make file more readable
sql/mysqld.cc:
Changed order of variables to make file more readable.
Support for changeable variables
Rename of system variables
Moved init_vars to set_var.cc
Changed output of --help
sql/net_pkg.cc:
Added my_net_local_init() to make it possible to set different defaults for network connection depending if you are a client, embedded library or server.
sql/net_serv.cc:
new changeable system variables
To support this, some global variables had to be move to the NET structure.
sql/records.cc:
new changeable system variables
use extra_opt()
sql/repl_failsafe.cc:
new changeable system variables
minior code cleanups
sql/repl_failsafe.h:
removed not needed external var reference
sql/share/czech/errmsg.txt:
new changeable system variables
sql/share/danish/errmsg.txt:
new changeable system variables
sql/share/dutch/errmsg.txt:
new changeable system variables
sql/share/english/errmsg.txt:
new changeable system variables
sql/share/estonian/errmsg.txt:
new changeable system variables
sql/share/french/errmsg.txt:
new changeable system variables
sql/share/german/errmsg.txt:
new changeable system variables
sql/share/greek/errmsg.txt:
new changeable system variables
sql/share/hungarian/errmsg.txt:
new changeable system variables
sql/share/italian/errmsg.txt:
new changeable system variables
sql/share/japanese/errmsg.txt:
new changeable system variables
sql/share/korean/errmsg.txt:
new changeable system variables
sql/share/norwegian-ny/errmsg.txt:
new changeable system variables
sql/share/norwegian/errmsg.txt:
new changeable system variables
sql/share/polish/errmsg.txt:
new changeable system variables
sql/share/portuguese/errmsg.txt:
new changeable system variables
sql/share/romanian/errmsg.txt:
new changeable system variables
sql/share/russian/errmsg.txt:
new changeable system variables
sql/share/slovak/errmsg.txt:
new changeable system variables
sql/share/spanish/errmsg.txt:
new changeable system variables
sql/share/swedish/errmsg.txt:
new changeable system variables
sql/share/ukrainian/errmsg.txt:
new changeable system variables
sql/slave.cc:
new changeable system variables
Added some suppression of error messages
Initialize current_thd for all slave threads.
sql/sql_acl.cc:
Added checking of arguments for SET PASSWORD (for new SET defintion)
sql/sql_acl.h:
new prototypes
sql/sql_base.cc:
new changeable system variables
sql/sql_cache.cc:
new changeable system variables
sql/sql_cache.h:
Renamed some arguments to make code more readable
sql/sql_class.cc:
new changeable system variables
sql/sql_class.h:
New changeable system variables
Code cleanup
sql/sql_db.cc:
Fixed bug in DROP DATABASE
sql/sql_delete.cc:
Usage of wrong define in test (possible speed problem)
sql/sql_insert.cc:
use extra_opt()
Code cleanup
sql/sql_lex.cc:
Added support for SET @@[global | session] system_variable
sql/sql_lex.h:
Added support for SET @@[global | session] system_variable
sql/sql_load.cc:
Cleanup for embedded library
Use extra_opt()
sql/sql_parse.cc:
Cleanup for embedded library
New changeable system variables
sql/sql_repl.cc:
new changeable system variables
sql/sql_repl.h:
Fixed variable definitions
sql/sql_select.cc:
new changeable system variables
sql/sql_show.cc:
New changeable system variables
sql/sql_table.cc:
Fixed bug in DROP DATABASE
sql/sql_union.cc:
New changeable system variables
sql/sql_update.cc:
Usage of wrong define in test (possible speed problem)
sql/sql_yacc.yy:
New changeable system variables
sql/structs.h:
Added typedef for SHOW_VAR
sql/table.cc:
Fixed bug in auto_increment on second part keys
sql/uniques.cc:
Comment fix
sql/unireg.h:
A
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_check.c | 12 | ||||
-rw-r--r-- | myisam/mi_extra.c | 41 | ||||
-rw-r--r-- | myisam/mi_open.c | 2 | ||||
-rw-r--r-- | myisam/mi_test1.c | 2 | ||||
-rw-r--r-- | myisam/mi_test2.c | 22 | ||||
-rw-r--r-- | myisam/mi_test3.c | 10 | ||||
-rw-r--r-- | myisam/mi_write.c | 9 | ||||
-rw-r--r-- | myisam/myisamchk.c | 4 | ||||
-rw-r--r-- | myisam/myisamdef.h | 2 | ||||
-rw-r--r-- | myisam/myisamlog.c | 4 | ||||
-rw-r--r-- | myisam/myisampack.c | 12 |
11 files changed, 72 insertions, 48 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index daecbb7ef2c..9196b74a4b9 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -455,7 +455,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) info->s->state.auto_increment=save_auto_value; /* Check that there isn't a row with auto_increment = 0 in the table */ - mi_extra(info,HA_EXTRA_KEYREAD); + mi_extra(info,HA_EXTRA_KEYREAD,0); bzero(info->lastkey,keyinfo->seg->length); if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey, keyinfo->seg->length, HA_READ_KEY_EXACT)) @@ -466,7 +466,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) "Found row where the auto_increment column has the value 0"); param->warning_printed=save; } - mi_extra(info,HA_EXTRA_NO_KEYREAD); + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); } length=(my_off_t) isam_key_length(info,keyinfo)*keys + param->key_blocks*2; @@ -1128,7 +1128,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, param->testflag|=T_REP; /* for easy checking */ if (!param->using_global_keycache) - VOID(init_key_cache(param->use_buffers,NEED_MEM)); + VOID(init_key_cache(param->use_buffers)); if (init_io_cache(¶m->read_cache,info->dfile, (uint) param->read_buffer_length, @@ -3601,12 +3601,12 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, !(param->testflag & T_REP)) printf("Updating MyISAM file: %s\n", param->isam_file_name); /* We have to use keyread here as a normal read uses info->rec_buff */ - mi_extra(info,HA_EXTRA_KEYREAD); + mi_extra(info,HA_EXTRA_KEYREAD,0); if (mi_rlast(info,info->rec_buff, info->s->base.auto_key-1)) { if (my_errno != HA_ERR_END_OF_FILE) { - mi_extra(info,HA_EXTRA_NO_KEYREAD); + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); mi_check_print_error(param,"%d when reading last record",my_errno); return; } @@ -3621,7 +3621,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, update_auto_increment(info,info->rec_buff); set_if_bigger(info->s->state.auto_increment,auto_increment); } - mi_extra(info,HA_EXTRA_NO_KEYREAD); + mi_extra(info,HA_EXTRA_NO_KEYREAD,0); update_state_info(param, info, UPDATE_AUTO_INC); return; } diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c index 9e514a6c055..6c658a33dda 100644 --- a/myisam/mi_extra.c +++ b/myisam/mi_extra.c @@ -14,11 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Extra functions we want to do with a database */ -/* - Set flags for quicker databasehandler */ -/* - Set databasehandler to normal */ -/* - Reset recordpointers as after open database */ - #include "myisamdef.h" #ifdef HAVE_MMAP #include <sys/mman.h> @@ -27,11 +22,28 @@ #include <errno.h> #endif - /* set extra flags for database */ +/* + Set options and buffers to optimize table handling + + SYNOPSIS + mi_extra() + info open table + function operation + extra_arg Pointer to extra argument (normally pointer to ulong) + Used when function is one of: + HA_EXTRA_WRITE_CACHE + HA_EXTRA_CACHE + HA_EXTRA_BULK_INSERT_BEGIN + If extra_arg is 0, then the default cache size is used. + RETURN VALUES + 0 ok +*/ -int mi_extra(MI_INFO *info, enum ha_extra_function function) + +int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) { int error=0; + ulong cache_size; MYISAM_SHARE *share=info->s; DBUG_ENTER("mi_extra"); DBUG_PRINT("enter",("function: %d",(int) function)); @@ -103,11 +115,13 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function) if (!(info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED | MEMMAP_USED))) { + cache_size= (extra_arg ? *(ulong*) extra_arg : + my_default_record_cache_size); if (!(init_io_cache(&info->rec_cache,info->dfile, (uint) min(info->state->data_file_length+1, - my_default_record_cache_size), - READ_CACHE,0L,(pbool) (info->lock_type != F_UNLCK), - MYF(share->write_flag & MY_WAIT_IF_FULL)))) + cache_size), + READ_CACHE,0L,(pbool) (info->lock_type != F_UNLCK), + MYF(share->write_flag & MY_WAIT_IF_FULL)))) { info->opt_flag|=READ_CACHE_USED; info->update&= ~HA_STATE_ROW_CHANGED; @@ -133,10 +147,12 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function) error=1; /* Not possibly if not locked */ break; } + cache_size= (extra_arg ? *(ulong*) extra_arg : + my_default_record_cache_size); if (!(info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) && !share->state.header.uniques) - if (!(init_io_cache(&info->rec_cache,info->dfile,0, + if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size, WRITE_CACHE,info->state->data_file_length, (pbool) (info->lock_type != F_UNLCK), MYF(share->write_flag & MY_WAIT_IF_FULL)))) @@ -337,7 +353,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function) info->quick_mode=1; break; case HA_EXTRA_BULK_INSERT_BEGIN: - error=_mi_init_bulk_insert(info); + error=_mi_init_bulk_insert(info, (extra_arg ? *(ulong*) extra_arg : + myisam_bulk_insert_tree_size)); break; case HA_EXTRA_BULK_INSERT_END: if (info->bulk_insert) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index c9ecdaab47f..e10d931e6d3 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -66,7 +66,7 @@ static MI_INFO *test_if_reopen(char *filename) MI_INFO *mi_open(const char *name, int mode, uint open_flags) { int lock_error,kfile,open_mode,save_errno; - uint i,j,len,errpos,head_length,base_pos,offset,info_length,extra,keys, + uint i,j,len,errpos,head_length,base_pos,offset,info_length,keys, key_parts,unique_key_parts,tmp_length,uniques; char name_buff[FN_REFLEN], org_name [FN_REFLEN], index_name[FN_REFLEN], data_name[FN_REFLEN]; diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index d0ce3ea966e..bcb9cd172ec 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -50,7 +50,7 @@ int main(int argc,char *argv[]) MY_INIT(argv[0]); my_init(); if (key_cacheing) - init_key_cache(IO_SIZE*16,(uint) IO_SIZE*4*10); + init_key_cache(IO_SIZE*16); get_options(argc,argv); exit(run_test("test1")); diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index 75129ac7667..93538e3ead7 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -208,13 +208,13 @@ int main(int argc, char *argv[]) if (!silent) printf("- Writing key:s\n"); if (key_cacheing) - init_key_cache(key_cache_size,(uint) IO_SIZE*4*10); /* Use a small cache */ + init_key_cache(key_cache_size); /* Use a small cache */ if (locking) mi_lock_database(file,F_WRLCK); if (write_cacheing) - mi_extra(file,HA_EXTRA_WRITE_CACHE); + mi_extra(file,HA_EXTRA_WRITE_CACHE,0); if (opt_quick_mode) - mi_extra(file,HA_EXTRA_QUICK); + mi_extra(file,HA_EXTRA_QUICK,0); for (i=0 ; i < recant ; i++) { @@ -261,11 +261,15 @@ int main(int argc, char *argv[]) if (testflag==1) goto end; if (write_cacheing) - if (mi_extra(file,HA_EXTRA_NO_CACHE)) + { + if (mi_extra(file,HA_EXTRA_NO_CACHE,0)) { puts("got error from mi_extra(HA_EXTRA_NO_CACHE)"); goto end; } + if (key_cacheing) + resize_key_cache(key_cache_size*2); + } if (!silent) printf("- Delete\n"); @@ -677,7 +681,7 @@ int main(int argc, char *argv[]) if (!silent) printf("- mi_extra(CACHE) + mi_rrnd.... + mi_extra(NO_CACHE)\n"); - if (mi_extra(file,HA_EXTRA_RESET) || mi_extra(file,HA_EXTRA_CACHE)) + if (mi_extra(file,HA_EXTRA_RESET,0) || mi_extra(file,HA_EXTRA_CACHE,0)) { if (locking || (!use_blob && !pack_fields)) { @@ -695,7 +699,7 @@ int main(int argc, char *argv[]) ant,write_count-opt_delete); goto end; } - if (mi_extra(file,HA_EXTRA_NO_CACHE)) + if (mi_extra(file,HA_EXTRA_NO_CACHE,0)) { puts("got error from mi_extra(HA_EXTRA_NO_CACHE)"); goto end; @@ -720,7 +724,7 @@ int main(int argc, char *argv[]) DBUG_PRINT("progpos",("Removing keys")); lastpos = HA_OFFSET_ERROR; /* DBUG_POP(); */ - mi_extra(file,HA_EXTRA_RESET); + mi_extra(file,HA_EXTRA_RESET,0); found_parts=0; while ((error=mi_rrnd(file,read_record,HA_OFFSET_ERROR)) != HA_ERR_END_OF_FILE) @@ -791,8 +795,10 @@ end: printf("myisam_block_size: %u\n", myisam_block_size); if (key_cacheing) { - puts("Key cacheing used"); + puts("Key cache used"); printf("key_cache_block_size: %u\n", key_cache_block_size); + if (write_cacheing) + puts("Key cache resized"); } if (write_cacheing) puts("Write cacheing used"); diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c index 36222c3edbc..ac36f55a181 100644 --- a/myisam/mi_test3.c +++ b/myisam/mi_test3.c @@ -173,7 +173,7 @@ void start_test(int id) exit(1); } if (key_cacheing && rnd(2) == 0) - init_key_cache(65536L,(uint) IO_SIZE*4*10); + init_key_cache(65536L); printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout); for (error=i=0 ; i < tests && !error; i++) @@ -302,7 +302,7 @@ int test_rrnd(MI_INFO *file,int id) return 1; } if (rnd(2) == 0) - mi_extra(file,HA_EXTRA_CACHE); + mi_extra(file,HA_EXTRA_CACHE,0); } count=0; @@ -323,7 +323,7 @@ int test_rrnd(MI_INFO *file,int id) end: if (lock) { - mi_extra(file,HA_EXTRA_NO_CACHE); + mi_extra(file,HA_EXTRA_NO_CACHE,0); if (mi_lock_database(file,F_UNLCK)) { fprintf(stderr,"%2d: Can't unlock table\n",id); @@ -355,7 +355,7 @@ int test_write(MI_INFO *file,int id,int lock_type) return 1; } if (rnd(2) == 0) - mi_extra(file,HA_EXTRA_WRITE_CACHE); + mi_extra(file,HA_EXTRA_WRITE_CACHE,0); } sprintf(record.id,"%7d",getpid()); @@ -380,7 +380,7 @@ int test_write(MI_INFO *file,int id,int lock_type) } if (lock) { - mi_extra(file,HA_EXTRA_NO_CACHE); + mi_extra(file,HA_EXTRA_NO_CACHE,0); if (mi_lock_database(file,F_UNLCK)) { fprintf(stderr,"%2d: Can't unlock table\n",id); diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 9998a25a96a..cfacd0bc4d5 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -801,7 +801,7 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param) } -int _mi_init_bulk_insert(MI_INFO *info) +int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size) { MYISAM_SHARE *share=info->s; MI_KEYDEF *key=share->keyinfo; @@ -809,6 +809,7 @@ int _mi_init_bulk_insert(MI_INFO *info) uint i, num_keys; ulonglong key_map=0; DBUG_ENTER("_mi_init_bulk_insert"); + DBUG_PRINT("enter",("cache_size: %lu", cache_size)); if (info->bulk_insert) DBUG_RETURN(0); @@ -824,7 +825,7 @@ int _mi_init_bulk_insert(MI_INFO *info) } if (num_keys==0 || - num_keys * MI_MIN_SIZE_BULK_INSERT_TREE > myisam_bulk_insert_tree_size) + num_keys * MI_MIN_SIZE_BULK_INSERT_TREE > cache_size) DBUG_RETURN(0); info->bulk_insert=(TREE *) @@ -842,8 +843,8 @@ int _mi_init_bulk_insert(MI_INFO *info) params->info=info; params->keynr=i; init_tree(&info->bulk_insert[i], - myisam_bulk_insert_tree_size / num_keys / 4 + 10, - myisam_bulk_insert_tree_size / num_keys, 0, + cache_size / num_keys / 4 + 10, + cache_size / num_keys, 0, (qsort_cmp2)keys_compare, 0, (tree_element_free) keys_free, (void *)params++); } diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index e91181ff420..ff8c47f93cc 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -1003,7 +1003,7 @@ static int myisamchk(MI_CHECK *param, my_string filename) !(param->testflag & (T_FAST | T_FORCE_CREATE))) { if (param->testflag & (T_EXTEND | T_MEDIUM)) - VOID(init_key_cache(param->use_buffers,(uint) NEED_MEM)); + VOID(init_key_cache(param->use_buffers)); VOID(init_io_cache(¶m->read_cache,datafile, (uint) param->read_buffer_length, READ_CACHE, @@ -1413,7 +1413,7 @@ static int mi_sort_records(MI_CHECK *param, if (share->state.key_root[sort_key] == HA_OFFSET_ERROR) DBUG_RETURN(0); /* Nothing to do */ - init_key_cache(param->use_buffers,NEED_MEM); + init_key_cache(param->use_buffers); if (init_io_cache(&info->rec_cache,-1,(uint) param->write_buffer_length, WRITE_CACHE,share->pack.header_length,1, MYF(MY_WME | MY_WAIT_IF_FULL))) diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 5790ae6f475..8c1ca393a3c 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -656,7 +656,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup); int mi_open_keyfile(MYISAM_SHARE *share); void mi_setup_functions(register MYISAM_SHARE *share); -int _mi_init_bulk_insert(MI_INFO *info); +int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size); /* Functions needed by mi_check */ void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...)); diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 2d4c7570956..ceca8d2a0e3 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -333,7 +333,7 @@ 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,(uint) (10*4*(IO_SIZE+MALLOC_OVERHEAD)))); + VOID(init_key_cache(KEY_CACHE_SIZE)); files_open=0; access_time=0; while (access_time++ != number_of_commands && @@ -484,7 +484,7 @@ static int examine_log(my_string file_name, char **table_names) command_name[command], (int) extra_command,result); if (update && curr_file_info && !curr_file_info->closed) { - if (mi_extra(curr_file_info->isam, extra_command) != (int) result) + if (mi_extra(curr_file_info->isam, extra_command, 0) != (int) result) { fflush(stdout); VOID(fprintf(stderr, diff --git a/myisam/myisampack.c b/myisam/myisampack.c index b7dd788821a..14fde9aa8b3 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -2088,7 +2088,7 @@ static void mrg_reset(PACK_MRG_INFO *mrg) { if (mrg->current) { - mi_extra(*mrg->current,HA_EXTRA_NO_CACHE); + mi_extra(*mrg->current, HA_EXTRA_NO_CACHE, 0); mrg->current=0; } } @@ -2103,8 +2103,8 @@ static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf) { isam_info= *(info->current=info->file); info->end=info->current+info->count; - mi_extra(isam_info,HA_EXTRA_RESET); - mi_extra(isam_info,HA_EXTRA_CACHE); + mi_extra(isam_info, HA_EXTRA_RESET, 0); + mi_extra(isam_info, HA_EXTRA_CACHE, 0); filepos=isam_info->s->pack.header_length; } else @@ -2120,14 +2120,14 @@ static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf) filepos, 1)) || error != HA_ERR_END_OF_FILE) return (error); - mi_extra(isam_info,HA_EXTRA_NO_CACHE); + mi_extra(isam_info,HA_EXTRA_NO_CACHE, 0); if (info->current+1 == info->end) return(HA_ERR_END_OF_FILE); info->current++; isam_info= *info->current; filepos=isam_info->s->pack.header_length; - mi_extra(isam_info,HA_EXTRA_RESET); - mi_extra(isam_info,HA_EXTRA_CACHE); + mi_extra(isam_info,HA_EXTRA_RESET, 0); + mi_extra(isam_info,HA_EXTRA_CACHE, 0); } } |