summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
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 /sql/mysqld.cc
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 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc43
1 files changed, 21 insertions, 22 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index f26f18418a8..a0b5d910986 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -355,7 +355,7 @@ struct system_variables max_system_variables;
MY_TMPDIR mysql_tmpdir_list;
MY_BITMAP temp_pool;
-KEY_CACHE_VAR *sql_key_cache;
+KEY_CACHE *sql_key_cache;
CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
@@ -1565,14 +1565,14 @@ We will try our best to scrape up some info that will hopefully help diagnose\n\
the problem, but since we have already crashed, something is definitely wrong\n\
and this may fail.\n\n");
fprintf(stderr, "key_buffer_size=%lu\n",
- (ulong) sql_key_cache->buff_size);
+ (ulong) sql_key_cache->key_cache_mem_size);
fprintf(stderr, "read_buffer_size=%ld\n", global_system_variables.read_buff_size);
fprintf(stderr, "max_used_connections=%ld\n", max_used_connections);
fprintf(stderr, "max_connections=%ld\n", max_connections);
fprintf(stderr, "threads_connected=%d\n", thread_count);
fprintf(stderr, "It is possible that mysqld could use up to \n\
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %ld K\n\
-bytes of memory\n", ((ulong) sql_key_cache->buff_size +
+bytes of memory\n", ((ulong) sql_key_cache->key_cache_mem_size +
(global_system_variables.read_buff_size +
global_system_variables.sortbuff_size) *
max_connections)/ 1024);
@@ -2037,7 +2037,6 @@ bool init_global_datetime_format(timestamp_type format_type,
{
/* Get command line option */
const char *str= opt_date_time_formats[format_type];
- DATE_TIME_FORMAT *format;
if (!str) // No specified format
{
@@ -2068,6 +2067,8 @@ static int init_common_variables(const char *conf_file_name, int argc,
max_system_variables.pseudo_thread_id= (ulong)~0;
start_time=time((time_t*) 0);
+ if (init_thread_environment())
+ return 1;
mysql_init_variables();
#ifdef OS2
@@ -2111,8 +2112,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
load_defaults(conf_file_name, groups, &argc, &argv);
defaults_argv=argv;
get_options(argc,argv);
- if (init_thread_environment())
- return 1;
if (opt_log || opt_update_log || opt_slow_log || opt_bin_log)
strcat(server_version,"-log");
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
@@ -2326,7 +2325,7 @@ Now disabling --log-slave-updates.");
/* call ha_init_key_cache() on all key caches to init them */
process_key_caches(&ha_init_key_cache);
/* We must set dflt_key_cache in case we are using ISAM tables */
- dflt_keycache= &sql_key_cache->cache;
+ dflt_key_cache= sql_key_cache;
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
if (locked_in_memory && !geteuid())
@@ -4316,26 +4315,26 @@ replicating a LOAD DATA INFILE command.",
IO_SIZE, 0},
{"key_buffer_size", OPT_KEY_BUFFER_SIZE,
"The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
- (gptr*) &dflt_key_cache_var.buff_size,
+ (gptr*) &dflt_key_cache_var.param_buff_size,
(gptr*) 0,
0, (enum get_opt_var_type) (GET_ULL | GET_ASK_ADDR),
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD,
IO_SIZE, 0},
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
"The default size of key cache blocks",
- (gptr*) &dflt_key_cache_var.block_size,
+ (gptr*) &dflt_key_cache_var.param_block_size,
(gptr*) 0,
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
KEY_CACHE_BLOCK_SIZE , 512, 1024*16, MALLOC_OVERHEAD, 512, 0},
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
"The minimum percentage of warm blocks in key cache",
- (gptr*) &dflt_key_cache_var.division_limit,
+ (gptr*) &dflt_key_cache_var.param_division_limit,
(gptr*) 0,
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
1, 100, 0, 1, 0},
{"key_cache_division_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
- (gptr*) &dflt_key_cache_var.age_threshold,
+ (gptr*) &dflt_key_cache_var.param_age_threshold,
(gptr*) 0,
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
300, 100, ~0L, 0, 100, 0},
@@ -4757,17 +4756,17 @@ struct show_var_st status_vars[]= {
{"Handler_rollback", (char*) &ha_rollback_count, SHOW_LONG},
{"Handler_update", (char*) &ha_update_count, SHOW_LONG},
{"Handler_write", (char*) &ha_write_count, SHOW_LONG},
- {"Key_blocks_not_flushed", (char*) &dflt_key_cache_var.blocks_changed,
+ {"Key_blocks_not_flushed", (char*) &dflt_key_cache_var.global_blocks_changed,
SHOW_KEY_CACHE_LONG},
- {"Key_blocks_used", (char*) &dflt_key_cache_var.blocks_used,
+ {"Key_blocks_used", (char*) &dflt_key_cache_var.global_blocks_used,
SHOW_KEY_CACHE_LONG},
- {"Key_read_requests", (char*) &dflt_key_cache_var.cache_r_requests,
+ {"Key_read_requests", (char*) &dflt_key_cache_var.global_cache_r_requests,
SHOW_KEY_CACHE_LONG},
- {"Key_reads", (char*) &dflt_key_cache_var.cache_read,
+ {"Key_reads", (char*) &dflt_key_cache_var.global_cache_read,
SHOW_KEY_CACHE_LONG},
- {"Key_write_requests", (char*) &dflt_key_cache_var.cache_w_requests,
+ {"Key_write_requests", (char*) &dflt_key_cache_var.global_cache_w_requests,
SHOW_KEY_CACHE_LONG},
- {"Key_writes", (char*) &dflt_key_cache_var.cache_write,
+ {"Key_writes", (char*) &dflt_key_cache_var.global_cache_write,
SHOW_KEY_CACHE_LONG},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST},
@@ -5608,18 +5607,18 @@ mysql_getopt_value(const char *keyname, uint key_length,
case OPT_KEY_CACHE_DIVISION_LIMIT:
case OPT_KEY_CACHE_AGE_THRESHOLD:
{
- KEY_CACHE_VAR *key_cache;
+ KEY_CACHE *key_cache;
if (!(key_cache= get_or_create_key_cache(keyname, key_length)))
exit(1);
switch (option->id) {
case OPT_KEY_BUFFER_SIZE:
- return (gptr*) &key_cache->buff_size;
+ return (gptr*) &key_cache->param_buff_size;
case OPT_KEY_CACHE_BLOCK_SIZE:
- return (gptr*) &key_cache->block_size;
+ return (gptr*) &key_cache->param_block_size;
case OPT_KEY_CACHE_DIVISION_LIMIT:
- return (gptr*) &key_cache->division_limit;
+ return (gptr*) &key_cache->param_division_limit;
case OPT_KEY_CACHE_AGE_THRESHOLD:
- return (gptr*) &key_cache->age_threshold;
+ return (gptr*) &key_cache->param_age_threshold;
}
}
}