mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Manual merge after improving concurrency for key cache reassignment
This commit is contained in:
@@ -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_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(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 *));
|
||||
|
||||
Reference in New Issue
Block a user