diff options
author | unknown <igor@rurik.mysql.com> | 2003-10-01 20:20:17 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2003-10-01 20:20:17 -0700 |
commit | 09e7be1d821831eee3bdeb0126a92aa7c23bed7d (patch) | |
tree | 1e1f87443b0524fc4518025161bb250daa10cb18 /sql/set_var.h | |
parent | 7c7ee4d2f4ae29df2167b0ca0e9ab6dfd93a1c07 (diff) | |
download | mariadb-git-09e7be1d821831eee3bdeb0126a92aa7c23bed7d.tar.gz |
Manual merge after improving concurrency for key cache reassignment
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index 812bd6c9420..76db478c50d 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -30,6 +30,11 @@ class set_var; typedef struct system_variables SV; extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib; +extern ulonglong dflt_key_buff_size; +extern uint dflt_key_cache_block_size; +extern uint dflt_key_cache_division_limit; +extern uint dflt_key_cache_age_threshold; + enum enum_var_type { OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL @@ -541,15 +546,71 @@ public: byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; -class sys_var_key_buffer_size :public sys_var +class sys_var_key_cache_param :public sys_var { +protected: + uint offset; public: - sys_var_key_buffer_size(const char *name_arg) + sys_var_key_cache_param(const char *name_arg) :sys_var(name_arg) - {} + { + offset= 0; + } + byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); +}; + +class sys_var_key_buffer_size :public sys_var_key_cache_param +{ +public: + sys_var_key_buffer_size(const char *name_arg) + :sys_var_key_cache_param(name_arg) + { + offset= offsetof(KEY_CACHE_VAR, buff_size); + } bool update(THD *thd, set_var *var); SHOW_TYPE type() { return SHOW_LONGLONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + bool check_default(enum_var_type type) { return 1; } + bool is_struct() { return 1; } +}; + +class sys_var_key_cache_block_size :public sys_var_key_cache_param +{ +public: + sys_var_key_cache_block_size(const char *name_arg) + :sys_var_key_cache_param(name_arg) + { + offset= offsetof(KEY_CACHE_VAR, block_size); + } + bool update(THD *thd, set_var *var); + SHOW_TYPE type() { return SHOW_LONG; } + bool check_default(enum_var_type type) { return 1; } + bool is_struct() { return 1; } +}; + +class sys_var_key_cache_division_limit :public sys_var_key_cache_param +{ +public: + sys_var_key_cache_division_limit(const char *name_arg) + :sys_var_key_cache_param(name_arg) + { + offset= offsetof(KEY_CACHE_VAR, division_limit); + } + bool update(THD *thd, set_var *var); + SHOW_TYPE type() { return SHOW_LONG; } + bool check_default(enum_var_type type) { return 1; } + bool is_struct() { return 1; } +}; + +class sys_var_key_cache_age_threshold :public sys_var_key_cache_param +{ +public: + sys_var_key_cache_age_threshold(const char *name_arg) + :sys_var_key_cache_param(name_arg) + { + offset= offsetof(KEY_CACHE_VAR, age_threshold); + } + bool update(THD *thd, set_var *var); + SHOW_TYPE type() { return SHOW_LONG; } bool check_default(enum_var_type type) { return 1; } bool is_struct() { return 1; } }; @@ -734,5 +795,6 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length, void delete_elements(I_List<NAMED_LIST> *list, void (*free_element)(gptr)); /* key_cache functions */ -KEY_CACHE *get_or_create_key_cache(const char *name, uint length); +KEY_CACHE_VAR *get_or_create_key_cache(const char *name, uint length); void free_key_cache(gptr key_cache); +bool process_key_caches(int (* func) (KEY_CACHE_VAR *)); |