cleanup: PSI key is *always* the first argument

This commit is contained in:
Sergei Golubchik 2020-02-27 11:52:20 +01:00
parent 7af733a5a2
commit c1c5222cae
90 changed files with 367 additions and 397 deletions

View file

@ -311,7 +311,7 @@ public:
int init()
{
return my_init_dynamic_array(&file_names, PSI_NOT_INSTRUMENTED, sizeof(File_name_record),
return my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &file_names, sizeof(File_name_record),
100, 100, MYF(0));
}
@ -3047,10 +3047,10 @@ int main(int argc, char** argv)
if (opt_flashback)
{
my_init_dynamic_array(&binlog_events, PSI_NOT_INSTRUMENTED, sizeof(LEX_STRING), 1024, 1024,
MYF(0));
my_init_dynamic_array(&events_in_stmt, PSI_NOT_INSTRUMENTED, sizeof(Rows_log_event*), 1024, 1024,
MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &binlog_events,
sizeof(LEX_STRING), 1024, 1024, MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &events_in_stmt,
sizeof(Rows_log_event*), 1024, 1024, MYF(0));
}
if (opt_stop_never)
to_last_remote_log= TRUE;

View file

@ -1194,13 +1194,13 @@ int main(int argc, char **argv)
}
if (opt_auto_repair &&
(my_init_dynamic_array(&tables4repair, PSI_NOT_INSTRUMENTED,
(my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &tables4repair,
NAME_LEN*2+2, 16, 64, MYF(0)) ||
my_init_dynamic_array(&views4repair, PSI_NOT_INSTRUMENTED,
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &views4repair,
NAME_LEN*2+2, 16, 64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, PSI_NOT_INSTRUMENTED,
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &tables4rebuild,
NAME_LEN*2+2, 16, 64, MYF(0)) ||
my_init_dynamic_array(&alter_table_cmds, PSI_NOT_INSTRUMENTED,
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &alter_table_cmds,
MAX_ALTER_STR_SIZE, 0, 1, MYF(0))))
goto end;

View file

@ -1001,11 +1001,11 @@ static int get_options(int *argc, char ***argv)
load_defaults_or_exit("my", load_default_groups, argc, argv);
defaults_argv= *argv;
if (my_hash_init(&ignore_database, charset_info, 16, 0, 0,
(my_hash_get_key) get_table_key, my_free, 0, PSI_NOT_INSTRUMENTED))
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0, 0,
(my_hash_get_key) get_table_key, my_free, 0))
return(EX_EOM);
if (my_hash_init(&ignore_table, charset_info, 16, 0, 0,
(my_hash_get_key) get_table_key, my_free, 0, PSI_NOT_INSTRUMENTED))
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_table, charset_info, 16, 0, 0,
(my_hash_get_key) get_table_key, my_free, 0))
return(EX_EOM);
/* Don't copy internal log tables */
if (my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED,

View file

@ -7427,7 +7427,7 @@ void init_win_path_patterns()
DBUG_ENTER("init_win_path_patterns");
my_init_dynamic_array(&patterns, PSI_NOT_INSTRUMENTED, sizeof(const char*), 16, 16, MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &patterns, sizeof(const char*), 16, 16, MYF(0));
/* Loop through all paths in the array */
for (i= 0; i < num_paths; i++)
@ -9185,10 +9185,10 @@ int main(int argc, char **argv)
cur_block->ok= TRUE; /* Outer block should always be executed */
cur_block->cmd= cmd_none;
my_init_dynamic_array(&q_lines, PSI_NOT_INSTRUMENTED, sizeof(struct st_command*), 1024, 1024, MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &q_lines, sizeof(struct st_command*), 1024, 1024, MYF(0));
if (my_hash_init2(&var_hash, 64, charset_info,
128, 0, 0, get_var_key, 0, var_free, MYF(0), PSI_NOT_INSTRUMENTED))
if (my_hash_init2(PSI_NOT_INSTRUMENTED, &var_hash, 64, charset_info, 128, 0,
0, get_var_key, 0, var_free, MYF(0)))
die("Variable hash initialization failed");
{
@ -10159,7 +10159,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
/* my_malloc() will die on fail with MY_FAE */
res=(struct st_replace_regex*)my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(*res)+8192 ,MYF(MY_FAE+MY_WME));
my_init_dynamic_array(&res->regex_arr,PSI_NOT_INSTRUMENTED, sizeof(struct st_regex), 128, 128, MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &res->regex_arr, sizeof(struct st_regex), 128, 128, MYF(0));
expr_end= expr + expr_len;
buf_p= (char*)res + sizeof(*res);
@ -11230,7 +11230,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input,
if (!*start)
DBUG_VOID_RETURN; /* No input */
my_init_dynamic_array(&lines, PSI_NOT_INSTRUMENTED, sizeof(const char*), 32, 32, MYF(0));
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &lines, sizeof(const char*), 32, 32, MYF(0));
if (keep_header)
{

View file

@ -958,7 +958,7 @@ static struct errors *generate_empty_message(uint d_code, my_bool skip)
if (!(new_error= (struct errors *) my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(*new_error), MYF(MY_WME))))
return(0);
if (my_init_dynamic_array(&new_error->msg, PSI_NOT_INSTRUMENTED,
if (my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &new_error->msg,
sizeof(struct message), 0, 1, MYF(0)))
return(0); /* OOM: Fatal error */
@ -999,7 +999,7 @@ static struct errors *parse_error_string(char *str, int er_count)
DBUG_RETURN(0);
new_error->next_error= 0;
if (my_init_dynamic_array(&new_error->msg, PSI_NOT_INSTRUMENTED,
if (my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &new_error->msg,
sizeof(struct message), 0, 0, MYF(0)))
DBUG_RETURN(0);

View file

@ -495,9 +495,9 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
pthread_mutex_t mutex;
int ret = 0;
if (my_hash_init(&filehash, &my_charset_bin, START_FILE_HASH_SIZE,
0, 0, (my_hash_get_key) get_file_entry_key,
(my_hash_free_key) file_entry_free, MYF(0), PSI_NOT_INSTRUMENTED)) {
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
START_FILE_HASH_SIZE, 0, 0, (my_hash_get_key) get_file_entry_key,
(my_hash_free_key) file_entry_free, MYF(0))) {
msg("%s: failed to initialize file hash.", my_progname);
return 1;
}

View file

@ -224,7 +224,7 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf)
static void init_sym_table()
{
char buf[512];
if (my_init_dynamic_array(&sym_table, PSI_NOT_INSTRUMENTED, sizeof(SYM_ENTRY),
if (my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &sym_table, sizeof(SYM_ENTRY),
INIT_SYM_TABLE, INC_SYM_TABLE, MYF(0)))
die("Failed in my_init_dynamic_array() -- looks like out of memory problem");

View file

@ -63,13 +63,12 @@ typedef struct st_hash {
/* A search iterator state */
typedef uint HASH_SEARCH_STATE;
#define my_hash_init(A,B,C,D,E,F,G,H,I) my_hash_init2(A,0,B,C,D,E,F,0,G,H,I)
my_bool my_hash_init2(HASH *hash, uint growth_size, CHARSET_INFO *charset,
ulong default_array_elements, size_t key_offset,
size_t key_length, my_hash_get_key get_key,
my_hash_function hash_function,
void (*free_element)(void*),
uint flags, PSI_memory_key psi_key);
#define my_hash_init(A,B,C,D,E,F,G,H,I) my_hash_init2(A,B,0,C,D,E,F,G,0,H,I)
my_bool my_hash_init2(PSI_memory_key psi_key, HASH *hash, uint growth_size,
CHARSET_INFO *charset, ulong default_array_elements,
size_t key_offset, size_t key_length,
my_hash_get_key get_key, my_hash_function hash_function,
void (*free_element)(void*), uint flags);
void my_hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
uchar *my_hash_element(HASH *hash, size_t idx);
@ -99,8 +98,8 @@ my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument);
#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
#define my_hash_inited(H) ((H)->blength != 0)
#define my_hash_init_opt(A,B,C,D,E,F,G,H, I) \
(!my_hash_inited(A) && my_hash_init(A,B,C,D,E,F,G,H, I))
#define my_hash_init_opt(A,B,C,D,E,F,G,H,I) \
(!my_hash_inited(B) && my_hash_init(A,B,C,D,E,F,G,H,I))
#ifdef __cplusplus
}

View file

@ -843,7 +843,7 @@ File create_temp_file(char *to, const char *dir, const char *pfx,
int mode, myf MyFlags);
#define my_init_dynamic_array(A,B,C,D,E,F) init_dynamic_array2(A,B,C,NULL,D,E,F)
#define my_init_dynamic_array2(A,B,C,D,E,F,G) init_dynamic_array2(A,B,C,D,E,F,G)
extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, PSI_memory_key psi_key,
extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
uint element_size, void *init_buffer,
uint init_alloc, uint alloc_increment,
myf my_flags);

View file

@ -40,7 +40,7 @@
FALSE Ok
*/
my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, PSI_memory_key psi_key,
my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
uint element_size, void *init_buffer,
uint init_alloc, uint alloc_increment, myf my_flags)
{

View file

@ -76,11 +76,11 @@ my_hash_value_type my_hash_sort(CHARSET_INFO *cs, const uchar *key,
@retval 1 failure
*/
my_bool
my_hash_init2(HASH *hash, uint growth_size, CHARSET_INFO *charset,
ulong size, size_t key_offset, size_t key_length,
my_hash_get_key get_key,
my_hash_init2(PSI_memory_key psi_key, HASH *hash, uint growth_size,
CHARSET_INFO *charset, ulong size, size_t key_offset,
size_t key_length, my_hash_get_key get_key,
my_hash_function hash_function,
void (*free_element)(void*), uint flags, PSI_memory_key psi_key)
void (*free_element)(void*), uint flags)
{
my_bool res;
DBUG_ENTER("my_hash_init2");
@ -95,7 +95,7 @@ my_hash_init2(HASH *hash, uint growth_size, CHARSET_INFO *charset,
hash->free=free_element;
hash->flags=flags;
hash->charset=charset;
res= init_dynamic_array2(&hash->array, psi_key, sizeof(HASH_LINK), NULL, size,
res= init_dynamic_array2(psi_key, &hash->array, sizeof(HASH_LINK), NULL, size,
growth_size, MYF((flags & HASH_THREAD_SPECIFIC ?
MY_THREAD_SPECIFIC : 0)));
DBUG_RETURN(res);
@ -889,9 +889,8 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
DBUG_PUSH("d:t:O,/tmp/test_hash.trace");
printf("my_hash_init\n");
if (my_hash_init2(&hash_test, 100, &my_charset_bin, 20,
0, 0, (my_hash_get_key) test_get_key, 0, 0, HASH_UNIQUE,
PSI_INSTRUMENT_ME))
if (my_hash_init2(PSI_INSTRUMENT_ME, &hash_test, 100, &my_charset_bin, 20,
0, 0, (my_hash_get_key) test_get_key, 0, 0, HASH_UNIQUE))
{
fprintf(stderr, "hash init failed\n");
exit(1);

View file

@ -2417,7 +2417,7 @@ dynamic_column_list(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_uint)
str->length)
return ER_DYNCOL_FORMAT;
if (my_init_dynamic_array(array_of_uint, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, array_of_uint,
sizeof(uint), header.column_count, 0, MYF(0)))
return ER_DYNCOL_RESOURCE;

View file

@ -30,7 +30,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL"));
mysql_mutex_init(key_TMPDIR_mutex, &tmpdir->mutex, MY_MUTEX_INIT_FAST);
if (my_init_dynamic_array(&tmpdir->full_list, key_memory_MY_TMPDIR_full_list,
if (my_init_dynamic_array(key_memory_MY_TMPDIR_full_list, &tmpdir->full_list,
sizeof(char*), 1, 5, MYF(0)))
goto err;
if (!pathlist || !pathlist[0])

View file

@ -416,7 +416,7 @@ int my_load_defaults(const char *conf_file, const char **groups, int *argc,
args_used= get_defaults_options(*argv);
if (my_init_dynamic_array(&args, key_memory_defaults, sizeof(char*), 128, 64,
if (my_init_dynamic_array(key_memory_defaults, &args, sizeof(char*), 128, 64,
MYF(0)))
goto err;

View file

@ -128,7 +128,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
MYF(MyFlags | MY_ZEROFILL))))
goto error;
if (my_init_dynamic_array(&dirh->array, key_memory_MY_DIR, sizeof(FILEINFO),
if (my_init_dynamic_array(key_memory_MY_DIR, &dirh->array, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT,
MYF(MyFlags)))
goto error;
@ -231,7 +231,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if (!(dirh= my_malloc(PSI_INSTRUMENT_ME, sizeof(*dirh), MyFlags | MY_ZEROFILL)))
goto error;
if (my_init_dynamic_array(&dirh->array, PSI_INSTRUMENT_ME, sizeof(FILEINFO),
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &dirh->array, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT,
MYF(MyFlags)))
goto error;

View file

@ -48,9 +48,9 @@ HASH likely_hash;
void init_my_likely()
{
/* Allocate big enough to avoid malloc calls */
my_hash_init2(&likely_hash, 10000, &my_charset_bin, 1024, 0, 0,
(my_hash_get_key) get_likely_key, 0,
free, HASH_UNIQUE, PSI_INSTRUMENT_ME);
my_hash_init2(PSI_NOT_INSTRUMENTED, &likely_hash, 10000, &my_charset_bin,
1024, 0, 0, (my_hash_get_key) get_likely_key, 0, free,
HASH_UNIQUE);
likely_inited= 1;
pthread_mutex_init(&likely_mutex, MY_MUTEX_INIT_FAST);
}

View file

@ -100,10 +100,9 @@ my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
uchar *default_value)
{
DBUG_ENTER("safe_hash_init");
if (my_hash_init(&hash->hash, &my_charset_bin, elements,
0, 0, (my_hash_get_key) safe_hash_entry_get,
(void (*)(void*)) safe_hash_entry_free, 0,
key_memory_SAFE_HASH_ENTRY))
if (my_hash_init(key_memory_SAFE_HASH_ENTRY, &hash->hash, &my_charset_bin,
elements, 0, 0, (my_hash_get_key) safe_hash_entry_get,
(void (*)(void*)) safe_hash_entry_free, 0))
{
hash->default_value= 0;
DBUG_RETURN(1);

View file

@ -169,12 +169,12 @@ static int safe_mutex_lazy_init_deadlock_detection(safe_mutex_t *mp)
pthread_mutex_lock(&THR_LOCK_mutex);
mp->id= ++safe_mutex_id;
pthread_mutex_unlock(&THR_LOCK_mutex);
my_hash_init2(mp->locked_mutex, 64, &my_charset_bin, 128,
my_hash_init2(PSI_NOT_INSTRUMENTED, mp->locked_mutex, 64, &my_charset_bin, 128,
offsetof(safe_mutex_deadlock_t, id), sizeof(mp->id), 0, 0, 0,
HASH_UNIQUE, PSI_NOT_INSTRUMENTED);
my_hash_init2(mp->used_mutex, 64, &my_charset_bin, 128,
HASH_UNIQUE);
my_hash_init2(PSI_NOT_INSTRUMENTED, mp->used_mutex, 64, &my_charset_bin, 128,
offsetof(safe_mutex_t, id), sizeof(mp->id), 0, 0, 0,
HASH_UNIQUE, PSI_NOT_INSTRUMENTED);
HASH_UNIQUE);
return 0;
}

View file

@ -394,7 +394,7 @@ static void wt_resource_create(uchar *arg)
bzero(rc, sizeof(*rc));
rc_rwlock_init(rc);
mysql_cond_init(key_WT_RESOURCE_cond, &rc->cond, 0);
my_init_dynamic_array(&rc->owners, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &rc->owners,
sizeof(WT_THD *), 0, 5, MYF(0));
DBUG_VOID_RETURN;
}
@ -508,7 +508,7 @@ void wt_thd_lazy_init(WT_THD *thd, const ulong *ds, const ulong *ts,
thd->deadlock_search_depth_long= dl;
thd->timeout_long= tl;
/* dynamic array is also initialized lazily - without memory allocations */
my_init_dynamic_array(&thd->my_resources, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &thd->my_resources,
sizeof(WT_RESOURCE *), 0, 5, MYF(0));
#ifndef DBUG_OFF
thd->name= my_thread_name();

View file

@ -816,7 +816,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
options->init_commands= (DYNAMIC_ARRAY*)my_malloc(key_memory_mysql_options,
sizeof(DYNAMIC_ARRAY),
MYF(MY_WME));
my_init_dynamic_array(options->init_commands, key_memory_mysql_options,
my_init_dynamic_array(key_memory_mysql_options, options->init_commands,
sizeof(char*),5, 5, MYF(0));
}
@ -4047,9 +4047,10 @@ mysql_options4(MYSQL *mysql,enum mysql_option option,
if (!my_hash_inited(&mysql->options.extension->connection_attributes))
{
if (my_hash_init(&mysql->options.extension->connection_attributes,
&my_charset_bin, 0, 0, 0, (my_hash_get_key) get_attr_key,
my_free, HASH_UNIQUE, key_memory_mysql_options))
if (my_hash_init(key_memory_mysql_options,
&mysql->options.extension->connection_attributes,
&my_charset_bin, 0, 0, 0, (my_hash_get_key)
get_attr_key, my_free, HASH_UNIQUE))
{
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(1);

View file

@ -3289,10 +3289,10 @@ bool ha_partition::populate_partition_name_hash()
DBUG_RETURN(false);
}
tot_names= m_is_sub_partitioned ? m_tot_parts + num_parts : num_parts;
if (my_hash_init(&part_share->partition_name_hash,
system_charset_info, tot_names, 0, 0,
(my_hash_get_key) get_part_name,
my_free, HASH_UNIQUE, key_memory_Partition_share))
if (my_hash_init(key_memory_Partition_share,
&part_share->partition_name_hash, system_charset_info,
tot_names, 0, 0, (my_hash_get_key) get_part_name, my_free,
HASH_UNIQUE))
{
unlock_shared_ha_data();
DBUG_RETURN(TRUE);

View file

@ -94,8 +94,8 @@ public:
first_link= NULL;
last_link= NULL;
(void) my_hash_free(&cache);
(void) my_hash_init(&cache,hash_charset,m_size,key_offset,
key_length, get_key, free_element, 0, m_psi_key);
(void) my_hash_init(m_psi_key, &cache,hash_charset,m_size,key_offset,
key_length, get_key, free_element, 0);
if (!locked)
mysql_mutex_unlock(&lock);
}

View file

@ -5617,14 +5617,9 @@ int item_create_init()
#ifdef HAVE_SPATIAL
count+= native_func_registry_array_geom.count();
#endif
if (my_hash_init(& native_functions_hash,
system_charset_info,
(ulong) count,
0,
0,
(my_hash_get_key) get_native_fct_hash_key,
NULL, /* Nothing to free */
MYF(0), key_memory_native_functions))
if (my_hash_init(key_memory_native_functions, & native_functions_hash,
system_charset_info, (ulong) count, 0, 0, (my_hash_get_key)
get_native_fct_hash_key, NULL, MYF(0)))
DBUG_RETURN(1);
if (native_func_registry_array.append_to_hash(&native_functions_hash))

View file

@ -4019,9 +4019,9 @@ longlong Item_func_get_lock::val_int()
DBUG_PRINT("enter", ("lock: %.*s", res->length(), res->ptr()));
/* HASH entries are of type User_level_lock. */
if (! my_hash_inited(&thd->ull_hash) &&
my_hash_init(&thd->ull_hash, &my_charset_bin,
16 /* small hash */, 0, 0, ull_get_key, NULL, 0,
key_memory_User_level_lock))
my_hash_init(key_memory_User_level_lock, &thd->ull_hash,
&my_charset_bin, 16 /* small hash */, 0, 0, ull_get_key,
NULL, 0))
{
DBUG_RETURN(0);
}

View file

@ -9564,8 +9564,8 @@ int TC_LOG_MMAP::recover()
goto err1;
}
if (my_hash_init(&xids, &my_charset_bin, tc_log_page_size/3, 0,
sizeof(my_xid), 0, 0, MYF(0), PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &xids, &my_charset_bin,
tc_log_page_size/3, 0, sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
for ( ; p < end_p ; p++)
@ -10078,9 +10078,8 @@ int TC_LOG_BINLOG::recover(LOG_INFO *linfo, const char *last_log_name,
#endif
if (! fdle->is_valid() ||
(do_xa && my_hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
sizeof(my_xid), 0, 0, MYF(0),
key_memory_binlog_recover_exec)))
(do_xa && my_hash_init(key_memory_binlog_recover_exec, &xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
sizeof(my_xid), 0, 0, MYF(0))))
goto err1;
if (do_xa)

View file

@ -1104,7 +1104,7 @@ void Rows_log_event::change_to_flashback_event(PRINT_EVENT_INFO *print_event_inf
if (((get_general_type_code() == WRITE_ROWS_EVENT) && (m_rows_buf==m_rows_end)))
goto end;
(void) my_init_dynamic_array(&rows_arr, PSI_NOT_INSTRUMENTED, sizeof(LEX_STRING), 8, 8, MYF(0));
(void) my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &rows_arr, sizeof(LEX_STRING), 8, 8, MYF(0));
for (uchar *value= m_rows_buf; value < m_rows_end; )
{

View file

@ -6395,7 +6395,7 @@ int handle_early_options()
my_getopt_skip_unknown= TRUE;
/* prepare all_early_options array */
my_init_dynamic_array(&all_early_options, PSI_NOT_INSTRUMENTED,
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &all_early_options,
sizeof(my_option), 100, 25, MYF(0));
add_many_options(&all_early_options, pfs_early_options,
array_elements(pfs_early_options));
@ -8570,7 +8570,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
my_getopt_error_reporter= option_error_reporter;
/* prepare all_options array */
my_init_dynamic_array(&all_options, PSI_INSTRUMENT_ME, sizeof(my_option),
my_init_dynamic_array(PSI_INSTRUMENT_ME, &all_options, sizeof(my_option),
array_elements(my_long_options) + sys_var_elements(),
array_elements(my_long_options)/4, MYF(0));
add_many_options(&all_options, my_long_options, array_elements(my_long_options));

View file

@ -1276,7 +1276,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
file= head->file;
record= head->record[0];
my_init_dynamic_array2(&ranges, PSI_INSTRUMENT_ME, sizeof(QUICK_RANGE*),
my_init_dynamic_array2(PSI_INSTRUMENT_ME, &ranges, sizeof(QUICK_RANGE*),
thd->alloc(sizeof(QUICK_RANGE*) * 16), 16, 16,
MYF(MY_THREAD_SPECIFIC));
@ -14507,8 +14507,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::init()
if (min_max_arg_part)
{
if (my_init_dynamic_array(&min_max_ranges, PSI_INSTRUMENT_ME,
sizeof(QUICK_RANGE*), 16, 16, MYF(MY_THREAD_SPECIFIC)))
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &min_max_ranges,
sizeof(QUICK_RANGE*), 16, 16,
MYF(MY_THREAD_SPECIFIC)))
return 1;
if (have_min)

View file

@ -742,7 +742,7 @@ void JOIN::add_keyuses_for_splitting()
save_query_plan(save_qep);
if (!keyuse.buffer &&
my_init_dynamic_array(&keyuse, PSI_INSTRUMENT_ME, sizeof(KEYUSE),
my_init_dynamic_array(PSI_INSTRUMENT_ME, &keyuse, sizeof(KEYUSE),
20, 64, MYF(MY_THREAD_SPECIFIC)))
goto err;

View file

@ -733,9 +733,8 @@ char *partition_info::find_duplicate_name()
max_names= num_parts;
if (is_sub_partitioned())
max_names+= num_parts * num_subparts;
if (my_hash_init(&partition_names, system_charset_info, max_names, 0, 0,
(my_hash_get_key) get_part_name_from_elem, 0, HASH_UNIQUE,
PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &partition_names, system_charset_info, max_names, 0, 0,
(my_hash_get_key) get_part_name_from_elem, 0, HASH_UNIQUE))
{
DBUG_ASSERT(0);
curr_name= (const uchar*) "Internal failure";

View file

@ -573,8 +573,9 @@ void free_table_ent(void* a)
void
Rpl_filter::init_table_rule_hash(HASH* h, bool* h_inited)
{
my_hash_init(h, system_charset_info,TABLE_RULE_HASH_SIZE,0,0,
get_table_key, free_table_ent, 0, key_memory_TABLE_RULE_ENT);
my_hash_init(key_memory_TABLE_RULE_ENT, h,
system_charset_info,TABLE_RULE_HASH_SIZE,0,0, get_table_key,
free_table_ent, 0);
*h_inited = 1;
}
@ -582,7 +583,7 @@ Rpl_filter::init_table_rule_hash(HASH* h, bool* h_inited)
void
Rpl_filter::init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited)
{
my_init_dynamic_array(a, key_memory_TABLE_RULE_ENT, sizeof(TABLE_RULE_ENT*),
my_init_dynamic_array(key_memory_TABLE_RULE_ENT, a, sizeof(TABLE_RULE_ENT*),
TABLE_RULE_ARR_SIZE, TABLE_RULE_ARR_SIZE, MYF(0));
*a_inited = 1;
}

View file

@ -248,10 +248,9 @@ rpl_slave_state::rpl_slave_state()
{
mysql_mutex_init(key_LOCK_slave_state, &LOCK_slave_state,
MY_MUTEX_INIT_SLOW);
my_hash_init(&hash, &my_charset_bin, 32, offsetof(element, domain_id),
sizeof(uint32), NULL, rpl_slave_state_free_element, HASH_UNIQUE,
PSI_INSTRUMENT_ME);
my_init_dynamic_array(&gtid_sort_array, PSI_INSTRUMENT_ME, sizeof(rpl_gtid),
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32, offsetof(element, domain_id),
sizeof(uint32), NULL, rpl_slave_state_free_element, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid),
8, 8, MYF(0));
}
@ -1114,8 +1113,9 @@ rpl_slave_state::iterate(int (*cb)(rpl_gtid *, void *), void *data,
int res= 1;
bool locked= false;
my_hash_init(&gtid_hash, &my_charset_bin, 32, offsetof(rpl_gtid, domain_id),
sizeof(uint32), NULL, NULL, HASH_UNIQUE, PSI_INSTRUMENT_ME);
my_hash_init(PSI_INSTRUMENT_ME, &gtid_hash, &my_charset_bin, 32,
offsetof(rpl_gtid, domain_id), sizeof(uint32), NULL, NULL,
HASH_UNIQUE);
for (i= 0; i < num_extra; ++i)
if (extra_gtids[i].server_id == global_system_variables.server_id &&
my_hash_insert(&gtid_hash, (uchar *)(&extra_gtids[i])))
@ -1487,9 +1487,9 @@ rpl_slave_state::alloc_gtid_pos_table(LEX_CSTRING *table_name, void *hton,
void rpl_binlog_state::init()
{
my_hash_init(&hash, &my_charset_bin, 32, offsetof(element, domain_id),
sizeof(uint32), NULL, my_free, HASH_UNIQUE, PSI_INSTRUMENT_ME);
my_init_dynamic_array(&gtid_sort_array, PSI_INSTRUMENT_ME, sizeof(rpl_gtid), 8, 8, MYF(0));
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32, offsetof(element, domain_id),
sizeof(uint32), NULL, my_free, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid), 8, 8, MYF(0));
mysql_mutex_init(key_LOCK_binlog_state, &LOCK_binlog_state,
MY_MUTEX_INIT_SLOW);
initialized= 1;
@ -1714,9 +1714,9 @@ rpl_binlog_state::alloc_element_nolock(const rpl_gtid *gtid)
if (elem && lookup_gtid)
{
elem->domain_id= gtid->domain_id;
my_hash_init(&elem->hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &elem->hash, &my_charset_bin, 32,
offsetof(rpl_gtid, server_id), sizeof(uint32), NULL, my_free,
HASH_UNIQUE, PSI_INSTRUMENT_ME);
HASH_UNIQUE);
elem->last_gtid= lookup_gtid;
elem->seq_no_counter= gtid->seq_no;
memcpy(lookup_gtid, gtid, sizeof(*lookup_gtid));
@ -1795,9 +1795,9 @@ rpl_binlog_state::bump_seq_no_if_needed(uint32 domain_id, uint64 seq_no)
}
elem->domain_id= domain_id;
my_hash_init(&elem->hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &elem->hash, &my_charset_bin, 32,
offsetof(rpl_gtid, server_id), sizeof(uint32), NULL, my_free,
HASH_UNIQUE, PSI_INSTRUMENT_ME);
HASH_UNIQUE);
elem->last_gtid= NULL;
elem->seq_no_counter= seq_no;
if (0 == my_hash_insert(&hash, (const uchar *)elem))
@ -2126,7 +2126,7 @@ rpl_binlog_state::drop_domain(DYNAMIC_ARRAY *ids,
DBUG_ENTER("rpl_binlog_state::drop_domain");
my_init_dynamic_array2(&domain_unique, PSI_INSTRUMENT_ME,
my_init_dynamic_array2(PSI_INSTRUMENT_ME, &domain_unique,
sizeof(element*), domain_unique_buffer,
sizeof(domain_unique_buffer) / sizeof(element*), 4, 0);
@ -2251,10 +2251,10 @@ end:
slave_connection_state::slave_connection_state()
{
my_hash_init(&hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
offsetof(entry, gtid) + offsetof(rpl_gtid, domain_id),
sizeof(uint32), NULL, my_free, HASH_UNIQUE, PSI_INSTRUMENT_ME);
my_init_dynamic_array(&gtid_sort_array, PSI_INSTRUMENT_ME, sizeof(rpl_gtid), 8, 8, MYF(0));
sizeof(uint32), NULL, my_free, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid), 8, 8, MYF(0));
}
@ -2877,9 +2877,9 @@ free_hash_element(void *p)
void
gtid_waiting::init()
{
my_hash_init(&hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
offsetof(hash_element, domain_id), sizeof(uint32), NULL,
free_hash_element, HASH_UNIQUE, PSI_INSTRUMENT_ME);
free_hash_element, HASH_UNIQUE);
mysql_mutex_init(key_LOCK_gtid_waiting, &LOCK_gtid_waiting, 0);
}

View file

@ -77,7 +77,7 @@ Master_info::Master_info(LEX_CSTRING *connection_name_arg,
parallel_mode= rpl_filter->get_parallel_mode();
my_init_dynamic_array(&ignore_server_ids, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &ignore_server_ids,
sizeof(global_system_variables.server_id), 16, 16,
MYF(0));
bzero((char*) &file, sizeof(file));
@ -1099,11 +1099,10 @@ bool Master_info_index::init_all_master_info()
}
/* Initialize Master_info Hash Table */
if (my_hash_init(&master_info_hash, system_charset_info,
if (my_hash_init(PSI_INSTRUMENT_ME, &master_info_hash, system_charset_info,
MAX_REPLICATION_THREAD, 0, 0,
(my_hash_get_key) get_key_master_info,
(my_hash_free_key)free_key_master_info, HASH_UNIQUE,
PSI_INSTRUMENT_ME))
(my_hash_free_key)free_key_master_info, HASH_UNIQUE))
{
sql_print_error("Initializing Master_info hash table failed");
DBUG_RETURN(1);
@ -1743,8 +1742,8 @@ Domain_id_filter::Domain_id_filter() : m_filter(false)
{
for (int i= DO_DOMAIN_IDS; i <= IGNORE_DOMAIN_IDS; i ++)
{
my_init_dynamic_array(&m_domain_ids[i], PSI_INSTRUMENT_ME,
sizeof(ulong), 16, 16, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &m_domain_ids[i], sizeof(ulong),
16, 16, MYF(0));
}
}

View file

@ -2199,9 +2199,9 @@ free_rpl_parallel_entry(void *element)
rpl_parallel::rpl_parallel() :
current(NULL), sql_thread_stopping(false)
{
my_hash_init(&domain_hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &domain_hash, &my_charset_bin, 32,
offsetof(rpl_parallel_entry, domain_id), sizeof(uint32),
NULL, free_rpl_parallel_entry, HASH_UNIQUE, PSI_INSTRUMENT_ME);
NULL, free_rpl_parallel_entry, HASH_UNIQUE);
}

View file

@ -1834,10 +1834,10 @@ rpl_load_gtid_slave_state(THD *thd)
cb_data.table_list= NULL;
cb_data.default_entry= NULL;
my_hash_init(&hash, &my_charset_bin, 32,
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
offsetof(gtid_pos_element, gtid) + offsetof(rpl_gtid, domain_id),
sizeof(uint32), NULL, my_free, HASH_UNIQUE, PSI_INSTRUMENT_ME);
if ((err= my_init_dynamic_array(&array, PSI_INSTRUMENT_ME,
sizeof(uint32), NULL, my_free, HASH_UNIQUE);
if ((err= my_init_dynamic_array(PSI_INSTRUMENT_ME, &array,
sizeof(gtid_pos_element), 0, 0, MYF(0))))
goto end;
array_inited= true;

View file

@ -48,9 +48,9 @@ table_mapping::table_mapping()
Note that below we don't test if my_hash_init() succeeded. This
constructor is called at startup only.
*/
(void) my_hash_init(&m_table_ids,&my_charset_bin,TABLE_ID_HASH_SIZE,
(void) my_hash_init(psi_key, &m_table_ids,&my_charset_bin,TABLE_ID_HASH_SIZE,
offsetof(entry,table_id),sizeof(ulonglong),
0,0,0, psi_key);
0,0,0);
/* We don't preallocate any block, this is consistent with m_free=0 above */
init_alloc_root(psi_key, &m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0, MYF(0));
DBUG_VOID_RETURN;

View file

@ -1123,7 +1123,7 @@ err:
Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL)
{
my_init_dynamic_array(&array, PSI_INSTRUMENT_ME, sizeof(Log_event *), 32, 16, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &array, sizeof(Log_event *), 32, 16, MYF(0));
}
Deferred_log_events::~Deferred_log_events()

View file

@ -142,10 +142,9 @@ class Session_sysvars_tracker: public State_tracker
bool track_all;
void init()
{
my_hash_init(&m_registered_sysvars, &my_charset_bin, 0, 0, 0,
(my_hash_get_key) sysvars_get_key, my_free, HASH_UNIQUE |
(mysqld_server_initialized ? HASH_THREAD_SPECIFIC : 0),
PSI_INSTRUMENT_ME);
my_hash_init(PSI_INSTRUMENT_ME, &m_registered_sysvars, &my_charset_bin,
0, 0, 0, (my_hash_get_key) sysvars_get_key, my_free,
HASH_UNIQUE | (mysqld_server_initialized ? HASH_THREAD_SPECIFIC : 0));
}
void free_hash()
{

View file

@ -65,9 +65,8 @@ int sys_var_init()
/* Must be already initialized. */
DBUG_ASSERT(system_charset_info != NULL);
if (my_hash_init(&system_variable_hash, system_charset_info, 700, 0,
0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE,
PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &system_variable_hash, system_charset_info, 700, 0,
0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
goto error;
if (mysql_add_sys_var_chain(all_sys_vars.first))

View file

@ -2301,9 +2301,9 @@ bool sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
const Sp_handler *handler,
TABLE_LIST *belong_to_view)
{
my_hash_init_opt(&prelocking_ctx->sroutines, system_charset_info,
my_hash_init_opt(PSI_INSTRUMENT_ME, &prelocking_ctx->sroutines, system_charset_info,
Query_tables_list::START_SROUTINES_HASH_SIZE,
0, 0, sp_sroutine_key, 0, 0, PSI_INSTRUMENT_ME);
0, 0, sp_sroutine_key, 0, 0);
if (!my_hash_search(&prelocking_ctx->sroutines, key->ptr(), key->length()))
{

View file

@ -302,9 +302,8 @@ sp_cache::~sp_cache()
void
sp_cache::init()
{
my_hash_init(&m_hashtable, system_charset_info, 0, 0, 0,
hash_get_key_for_sp_head, hash_free_sp_head, 0,
key_memory_sp_cache);
my_hash_init(key_memory_sp_cache, &m_hashtable, system_charset_info, 0, 0, 0,
hash_get_key_for_sp_head, hash_free_sp_head, 0);
}

View file

@ -580,12 +580,12 @@ sp_head::sp_head(MEM_ROOT *mem_root_arg, sp_package *parent,
m_backpatch_goto.empty();
m_cont_backpatch.empty();
m_lex.empty();
my_init_dynamic_array(&m_instr, key_memory_sp_head_main_root,
my_init_dynamic_array(key_memory_sp_head_main_root, &m_instr,
sizeof(sp_instr *), 16, 8, MYF(0));
my_hash_init(&m_sptabs, system_charset_info, 0, 0, 0, sp_table_key, 0, 0,
key_memory_sp_head_main_root);
my_hash_init(&m_sroutines, system_charset_info, 0, 0, 0, sp_sroutine_key,
0, 0, key_memory_sp_head_main_root);
my_hash_init(key_memory_sp_head_main_root, &m_sptabs, system_charset_info, 0,
0, 0, sp_table_key, 0, 0);
my_hash_init(key_memory_sp_head_main_root, &m_sroutines, system_charset_info,
0, 0, 0, sp_sroutine_key, 0, 0);
DBUG_VOID_RETURN;
}

View file

@ -2461,7 +2461,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
user.sort= get_magic_sort("hu", user.host.hostname, user.user.str);
user.hostname_length= safe_strlen(user.host.hostname);
my_init_dynamic_array(&user.role_grants, key_memory_acl_mem,
my_init_dynamic_array(key_memory_acl_mem, &user.role_grants,
sizeof(ACL_ROLE *), 0, 8, MYF(0));
user.account_locked= user_table.get_account_locked();
@ -2480,7 +2480,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
ACL_ROLE *entry= new (&acl_memroot) ACL_ROLE(&user, &acl_memroot);
entry->role_grants = user.role_grants;
my_init_dynamic_array(&entry->parent_grantee, key_memory_acl_mem,
my_init_dynamic_array(key_memory_acl_mem, &entry->parent_grantee,
sizeof(ACL_USER_BASE *), 0, 8, MYF(0));
my_hash_insert(&acl_roles, (uchar *)entry);
@ -2744,16 +2744,16 @@ bool acl_reload(THD *thd)
old_acl_roles_mappings= acl_roles_mappings;
old_acl_proxy_users= acl_proxy_users;
old_acl_dbs= acl_dbs;
my_init_dynamic_array(&acl_hosts, key_memory_acl_mem, sizeof(ACL_HOST), 20, 50, MYF(0));
my_init_dynamic_array(&acl_users, key_memory_acl_mem, sizeof(ACL_USER), 50, 100, MYF(0));
my_init_dynamic_array(key_memory_acl_mem, &acl_hosts, sizeof(ACL_HOST), 20, 50, MYF(0));
my_init_dynamic_array(key_memory_acl_mem, &acl_users, sizeof(ACL_USER), 50, 100, MYF(0));
acl_dbs.init(key_memory_acl_mem, 50, 100);
my_init_dynamic_array(&acl_proxy_users, key_memory_acl_mem, sizeof(ACL_PROXY_USER), 50, 100, MYF(0));
my_hash_init2(&acl_roles,50, &my_charset_utf8mb3_bin,
my_init_dynamic_array(key_memory_acl_mem, &acl_proxy_users, sizeof(ACL_PROXY_USER), 50, 100, MYF(0));
my_hash_init2(key_memory_acl_mem, &acl_roles,50, &my_charset_utf8mb3_bin,
0, 0, 0, (my_hash_get_key) acl_role_get_key, 0,
(void (*)(void *))free_acl_role, 0, key_memory_acl_mem);
my_hash_init2(&acl_roles_mappings, 50, &my_charset_utf8mb3_bin, 0, 0, 0,
(my_hash_get_key) acl_role_map_get_key, 0, 0, 0,
key_memory_acl_mem);
(void (*)(void *))free_acl_role, 0);
my_hash_init2(key_memory_acl_mem, &acl_roles_mappings, 50,
&my_charset_utf8mb3_bin, 0, 0, 0, (my_hash_get_key)
acl_role_map_get_key, 0, 0, 0);
old_mem= acl_memroot;
delete_dynamic(&acl_wild_hosts);
my_hash_free(&acl_check_hosts);
@ -3191,7 +3191,7 @@ ACL_USER::ACL_USER(THD *thd, const LEX_USER &combo,
sort= get_magic_sort("hu", host.hostname, user.str);
password_last_changed= thd->query_start();
password_lifetime= -1;
my_init_dynamic_array(&role_grants, PSI_INSTRUMENT_ME, sizeof(ACL_USER *), 0, 8, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &role_grants, sizeof(ACL_USER *), 0, 8, MYF(0));
}
@ -3276,9 +3276,9 @@ static void acl_insert_role(const char *rolename, privilege_t privileges)
mysql_mutex_assert_owner(&acl_cache->lock);
entry= new (&acl_memroot) ACL_ROLE(rolename, privileges, &acl_memroot);
my_init_dynamic_array(&entry->parent_grantee, key_memory_acl_mem,
my_init_dynamic_array(key_memory_acl_mem, &entry->parent_grantee,
sizeof(ACL_USER_BASE *), 0, 8, MYF(0));
my_init_dynamic_array(&entry->role_grants, key_memory_acl_mem,
my_init_dynamic_array(key_memory_acl_mem, &entry->role_grants,
sizeof(ACL_ROLE *), 0, 8, MYF(0));
my_hash_insert(&acl_roles, (uchar *)entry);
@ -3451,12 +3451,12 @@ exit:
static void init_check_host(void)
{
DBUG_ENTER("init_check_host");
(void) my_init_dynamic_array(&acl_wild_hosts, key_memory_acl_mem,
(void) my_init_dynamic_array(key_memory_acl_mem, &acl_wild_hosts,
sizeof(struct acl_host_and_ip),
acl_users.elements, 1, MYF(0));
(void) my_hash_init(&acl_check_hosts,system_charset_info, acl_users.elements,
0, 0, (my_hash_get_key) check_get_key, 0, 0,
key_memory_acl_mem);
(void) my_hash_init(key_memory_acl_mem, &acl_check_hosts,system_charset_info,
acl_users.elements, 0, 0,
(my_hash_get_key) check_get_key, 0, 0);
if (!allow_all_hosts)
{
for (uint i=0 ; i < acl_users.elements ; i++)
@ -5101,9 +5101,8 @@ public:
bool ok() { return privs != NO_ACL || cols != NO_ACL; }
void init_hash()
{
my_hash_init2(&hash_columns, 4, system_charset_info, 0, 0, 0,
(my_hash_get_key) get_key_column, 0, 0, 0,
key_memory_acl_memex);
my_hash_init2(key_memory_acl_memex, &hash_columns, 4, system_charset_info,
0, 0, 0, (my_hash_get_key) get_key_column, 0, 0, 0);
}
};
@ -5369,8 +5368,7 @@ column_hash_search(GRANT_TABLE *t, const char *cname, size_t length)
{
if (!my_hash_inited(&t->hash_columns))
return (GRANT_COLUMN*) 0;
return (GRANT_COLUMN*) my_hash_search(&t->hash_columns,
(uchar*) cname, length);
return (GRANT_COLUMN*)my_hash_search(&t->hash_columns, (uchar*)cname, length);
}
@ -7652,22 +7650,21 @@ static bool grant_load(THD *thd,
Sql_mode_instant_remove sms(thd, MODE_PAD_CHAR_TO_FULL_LENGTH);
(void) my_hash_init(&column_priv_hash, &my_charset_utf8mb3_bin,
0,0,0, (my_hash_get_key) get_grant_table,
(my_hash_free_key) free_grant_table, 0,
key_memory_acl_memex);
(void) my_hash_init(&proc_priv_hash, &my_charset_utf8mb3_bin,
0,0,0, (my_hash_get_key) get_grant_table, 0,0,
key_memory_acl_memex);
(void) my_hash_init(&func_priv_hash, &my_charset_utf8mb3_bin,
0,0,0, (my_hash_get_key) get_grant_table, 0,0,
key_memory_acl_memex);
(void) my_hash_init(&package_spec_priv_hash, &my_charset_utf8mb3_bin,
0,0,0, (my_hash_get_key) get_grant_table, 0,0,
key_memory_acl_memex);
(void) my_hash_init(&package_body_priv_hash, &my_charset_utf8mb3_bin,
0,0,0, (my_hash_get_key) get_grant_table, 0,0,
key_memory_acl_memex);
(void) my_hash_init(key_memory_acl_memex, &column_priv_hash,
&my_charset_utf8mb3_bin, 0,0,0, (my_hash_get_key)
get_grant_table, (my_hash_free_key) free_grant_table, 0);
(void) my_hash_init(key_memory_acl_memex, &proc_priv_hash,
&my_charset_utf8mb3_bin, 0,0,0, (my_hash_get_key)
get_grant_table, 0,0);
(void) my_hash_init(key_memory_acl_memex, &func_priv_hash,
&my_charset_utf8mb3_bin, 0,0,0, (my_hash_get_key)
get_grant_table, 0,0);
(void) my_hash_init(key_memory_acl_memex, &package_spec_priv_hash,
&my_charset_utf8mb3_bin, 0,0,0, (my_hash_get_key)
get_grant_table, 0,0);
(void) my_hash_init(key_memory_acl_memex, &package_body_priv_hash,
&my_charset_utf8mb3_bin, 0,0,0, (my_hash_get_key)
get_grant_table, 0,0);
init_sql_alloc(key_memory_acl_mem, &grant_memroot, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
t_table= tables_priv.table();

View file

@ -122,13 +122,13 @@ public:
Dynamic_array(MEM_ROOT *root, uint prealloc=16, uint increment=16)
{
void *init_buffer= alloc_root(root, sizeof(Elem) * prealloc);
init_dynamic_array2(&array, root->m_psi_key, sizeof(Elem), init_buffer,
init_dynamic_array2(root->m_psi_key, &array, sizeof(Elem), init_buffer,
prealloc, increment, MYF(0));
}
void init(PSI_memory_key psi_key, uint prealloc=16, uint increment=16)
{
init_dynamic_array2(&array, psi_key, sizeof(Elem), 0, prealloc, increment, MYF(0));
init_dynamic_array2(psi_key, &array, sizeof(Elem), 0, prealloc, increment, MYF(0));
}
/**

View file

@ -88,7 +88,7 @@ static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
if (unlikely(!thd->audit_class_plugins.buffer))
{
/* specify some reasonable initialization defaults */
my_init_dynamic_array(&thd->audit_class_plugins, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &thd->audit_class_plugins,
sizeof(plugin_ref), 16, 16, MYF(0));
}

View file

@ -571,7 +571,7 @@ bool flush_tables(THD *thd, flush_tables_type flag)
MYF(MY_WME | MY_THREAD_SPECIFIC))))
DBUG_RETURN(1);
my_init_dynamic_array(&collect_arg.shares, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &collect_arg.shares,
sizeof(TABLE_SHARE*), 100, 100, MYF(0));
collect_arg.flush_type= flag;
if (tdc_iterate(thd, (my_hash_walk_action) tc_collect_used_shares,

View file

@ -2727,8 +2727,8 @@ size_t Query_cache::init_cache()
DUMP(this);
(void) my_hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0,
query_cache_query_get_key, 0, 0, key_memory_Query_cache);
(void) my_hash_init(key_memory_Query_cache, &queries, &my_charset_bin,
def_query_hash_size, 0,0, query_cache_query_get_key,0,0);
#ifndef FN_NO_CASE_SENSE
/*
If lower_case_table_names!=0 then db and table names are already
@ -2738,8 +2738,8 @@ size_t Query_cache::init_cache()
lower_case_table_names == 0 then we should distinguish my_table
and MY_TABLE cases and so again can use binary collation.
*/
(void) my_hash_init(&tables, &my_charset_bin, def_table_hash_size, 0, 0,
query_cache_table_get_key, 0, 0, key_memory_Query_cache);
(void) my_hash_init(key_memory_Query_cache, &tables, &my_charset_bin,
def_table_hash_size, 0,0, query_cache_table_get_key, 0,0);
#else
/*
On windows, OS/2, MacOS X with HFS+ or any other case insensitive
@ -2749,11 +2749,9 @@ size_t Query_cache::init_cache()
file system) and so should use case insensitive collation for
comparison.
*/
(void) my_hash_init(&tables,
lower_case_table_names ? &my_charset_bin :
files_charset_info,
def_table_hash_size, 0, 0,query_cache_table_get_key,
0, 0, PSI_INSTRUMENT_ME);
(void) my_hash_init(PSI_INSTRUMENT_ME, &tables, lower_case_table_names ?
&my_charset_bin : files_charset_info,
def_table_hash_size, 0,0, query_cache_table_get_key, 0,0);
#endif
queries_in_cache = 0;

View file

@ -845,14 +845,13 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
profiling.set_thd(this);
#endif
user_connect=(USER_CONN *)0;
my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(my_hash_get_key) get_var_key,
(my_hash_free_key) free_user_var, HASH_THREAD_SPECIFIC,
key_memory_user_var_entry);
my_hash_init(&sequences, system_charset_info, SEQUENCES_HASH_SIZE, 0, 0,
(my_hash_get_key) get_sequence_last_key,
(my_hash_free_key) free_sequence_last, HASH_THREAD_SPECIFIC,
PSI_INSTRUMENT_ME);
my_hash_init(key_memory_user_var_entry, &user_vars, system_charset_info,
USER_VARS_HASH_SIZE, 0, 0, (my_hash_get_key) get_var_key,
(my_hash_free_key) free_user_var, HASH_THREAD_SPECIFIC);
my_hash_init(PSI_INSTRUMENT_ME, &sequences, system_charset_info,
SEQUENCES_HASH_SIZE, 0, 0, (my_hash_get_key)
get_sequence_last_key, (my_hash_free_key) free_sequence_last,
HASH_THREAD_SPECIFIC);
sp_proc_cache= NULL;
sp_func_cache= NULL;
@ -861,7 +860,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
/* For user vars replication*/
if (opt_bin_log)
my_init_dynamic_array(&user_var_events, key_memory_user_var_entry,
my_init_dynamic_array(key_memory_user_var_entry, &user_var_events,
sizeof(BINLOG_USER_VAR_EVENT *), 16, 16, MYF(0));
else
bzero((char*) &user_var_events, sizeof(user_var_events));
@ -1443,14 +1442,13 @@ void THD::change_user(void)
init();
stmt_map.reset();
my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(my_hash_get_key) get_var_key,
(my_hash_free_key) free_user_var, HASH_THREAD_SPECIFIC,
key_memory_user_var_entry);
my_hash_init(&sequences, system_charset_info, SEQUENCES_HASH_SIZE, 0, 0,
(my_hash_get_key) get_sequence_last_key,
(my_hash_free_key) free_sequence_last, HASH_THREAD_SPECIFIC,
key_memory_user_var_entry);
my_hash_init(key_memory_user_var_entry, &user_vars, system_charset_info,
USER_VARS_HASH_SIZE, 0, 0, (my_hash_get_key) get_var_key,
(my_hash_free_key) free_user_var, HASH_THREAD_SPECIFIC);
my_hash_init(key_memory_user_var_entry, &sequences, system_charset_info,
SEQUENCES_HASH_SIZE, 0, 0, (my_hash_get_key)
get_sequence_last_key, (my_hash_free_key) free_sequence_last,
HASH_THREAD_SPECIFIC);
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);
sp_cache_clear(&sp_package_spec_cache);
@ -3929,13 +3927,12 @@ Statement_map::Statement_map() :
START_STMT_HASH_SIZE = 16,
START_NAME_HASH_SIZE = 16
};
my_hash_init(&st_hash, &my_charset_bin, START_STMT_HASH_SIZE, 0, 0,
get_statement_id_as_hash_key,
delete_statement_as_hash_key, MYF(0),
key_memory_prepared_statement_map);
my_hash_init(&names_hash, system_charset_info, START_NAME_HASH_SIZE, 0, 0,
my_hash_init(key_memory_prepared_statement_map, &st_hash, &my_charset_bin,
START_STMT_HASH_SIZE, 0, 0, get_statement_id_as_hash_key,
delete_statement_as_hash_key, MYF(0));
my_hash_init(key_memory_prepared_statement_map, &names_hash, system_charset_info, START_NAME_HASH_SIZE, 0, 0,
(my_hash_get_key) get_stmt_name_hash_key,
NULL, MYF(0), key_memory_prepared_statement_map);
NULL, MYF(0));
}

View file

@ -322,9 +322,9 @@ extern "C" void free_user(struct user_conn *uc)
void init_max_user_conn(void)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
my_hash_init(&hash_user_connections, system_charset_info, max_connections,
0, 0, (my_hash_get_key) get_key_conn,
(my_hash_free_key) free_user, 0, key_memory_user_conn);
my_hash_init(key_memory_user_conn, &hash_user_connections,
system_charset_info, max_connections, 0, 0, (my_hash_get_key)
get_key_conn, (my_hash_free_key) free_user, 0);
#endif
}
@ -483,16 +483,16 @@ void init_user_stats(USER_STATS *user_stats,
void init_global_user_stats(void)
{
my_hash_init(&global_user_stats, system_charset_info, max_connections,
my_hash_init(PSI_INSTRUMENT_ME, &global_user_stats, system_charset_info, max_connections,
0, 0, (my_hash_get_key) get_key_user_stats,
(my_hash_free_key) free_user_stats, 0, PSI_INSTRUMENT_ME);
(my_hash_free_key) free_user_stats, 0);
}
void init_global_client_stats(void)
{
my_hash_init(&global_client_stats, system_charset_info, max_connections,
my_hash_init(PSI_INSTRUMENT_ME, &global_client_stats, system_charset_info, max_connections,
0, 0, (my_hash_get_key) get_key_user_stats,
(my_hash_free_key) free_user_stats, 0, PSI_INSTRUMENT_ME);
(my_hash_free_key) free_user_stats, 0);
}
extern "C" uchar *get_key_table_stats(TABLE_STATS *table_stats, size_t *length,
@ -509,9 +509,9 @@ extern "C" void free_table_stats(TABLE_STATS* table_stats)
void init_global_table_stats(void)
{
my_hash_init(&global_table_stats, system_charset_info, max_connections,
0, 0, (my_hash_get_key) get_key_table_stats,
(my_hash_free_key) free_table_stats, 0, PSI_INSTRUMENT_ME);
my_hash_init(PSI_INSTRUMENT_ME, &global_table_stats, system_charset_info,
max_connections, 0, 0, (my_hash_get_key) get_key_table_stats,
(my_hash_free_key) free_table_stats, 0);
}
extern "C" uchar *get_key_index_stats(INDEX_STATS *index_stats, size_t *length,
@ -528,9 +528,9 @@ extern "C" void free_index_stats(INDEX_STATS* index_stats)
void init_global_index_stats(void)
{
my_hash_init(&global_index_stats, system_charset_info, max_connections,
0, 0, (my_hash_get_key) get_key_index_stats,
(my_hash_free_key) free_index_stats, 0, PSI_INSTRUMENT_ME);
my_hash_init(PSI_INSTRUMENT_ME, &global_index_stats, system_charset_info,
max_connections, 0, 0, (my_hash_get_key) get_key_index_stats,
(my_hash_free_key) free_index_stats, 0);
}

View file

@ -186,9 +186,9 @@ bool my_dboptions_cache_init(void)
if (!dboptions_init)
{
dboptions_init= 1;
error= my_hash_init(&dboptions, table_alias_charset,
32, 0, 0, (my_hash_get_key) dboptions_get_key,
free_dbopt, 0, key_memory_dboptions_hash);
error= my_hash_init(key_memory_dboptions_hash, &dboptions,
table_alias_charset, 32, 0, 0, (my_hash_get_key)
dboptions_get_key, free_dbopt, 0);
}
return error;
}
@ -218,9 +218,8 @@ void my_dbopt_cleanup(void)
{
mysql_rwlock_wrlock(&LOCK_dboptions);
my_hash_free(&dboptions);
my_hash_init(&dboptions, table_alias_charset,
32, 0, 0, (my_hash_get_key) dboptions_get_key,
free_dbopt, 0, key_memory_dboptions_hash);
my_hash_init(key_memory_dboptions_hash, &dboptions, table_alias_charset, 32,
0, 0, (my_hash_get_key) dboptions_get_key, free_dbopt, 0);
mysql_rwlock_unlock(&LOCK_dboptions);
}

View file

@ -289,11 +289,11 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
/*
HASH entries are of type SQL_HANDLER
*/
if (my_hash_init(&thd->handler_tables_hash, &my_charset_latin1,
HANDLER_TABLES_HASH_SIZE, 0, 0,
(my_hash_get_key) mysql_ha_hash_get_key,
(my_hash_free_key) mysql_ha_hash_free, 0,
key_memory_THD_handler_tables_hash))
if (my_hash_init(key_memory_THD_handler_tables_hash,
&thd->handler_tables_hash, &my_charset_latin1,
HANDLER_TABLES_HASH_SIZE, 0, 0, (my_hash_get_key)
mysql_ha_hash_get_key, (my_hash_free_key)
mysql_ha_hash_free, 0))
{
DBUG_PRINT("exit",("ERROR"));
DBUG_RETURN(TRUE);

View file

@ -43,8 +43,8 @@ public:
size_t key_offset, size_t key_length, my_hash_get_key get_key,
void (*free_element)(void*), uint flags)
{
my_hash_init(&m_hash, charset, default_array_elements, key_offset,
key_length, get_key, free_element, flags, psi_key);
my_hash_init(psi_key, &m_hash, charset, default_array_elements, key_offset,
key_length, get_key, free_element, flags);
}
/**
Destroy the hash by freeing the buckets table. Does
@ -65,8 +65,8 @@ public:
*/
bool insert(T *value)
{
my_hash_init_opt(&m_hash, m_hash.charset, START_SIZE, 0, 0,
m_hash.get_key, 0, HASH_UNIQUE, m_hash.array.m_psi_key);
my_hash_init_opt(m_hash.array.m_psi_key, &m_hash, m_hash.charset,
START_SIZE, 0, 0, m_hash.get_key, 0, HASH_UNIQUE);
return my_hash_insert(&m_hash, reinterpret_cast<const uchar*>(value));
}
bool remove(T *value)

View file

@ -3826,13 +3826,12 @@ LEX::LEX()
default_used(0), is_lex_started(0), limit_rows_examined_cnt(ULONGLONG_MAX)
{
init_dynamic_array2(&plugins, PSI_INSTRUMENT_ME,
sizeof(plugin_ref), plugins_static_buffer,
INITIAL_LEX_PLUGIN_LIST_SIZE,
init_dynamic_array2(PSI_INSTRUMENT_ME, &plugins, sizeof(plugin_ref),
plugins_static_buffer, INITIAL_LEX_PLUGIN_LIST_SIZE,
INITIAL_LEX_PLUGIN_LIST_SIZE, 0);
reset_query_tables_list(TRUE);
mi.init();
init_dynamic_array2(&delete_gtid_domain, PSI_INSTRUMENT_ME, sizeof(uint32),
init_dynamic_array2(PSI_INSTRUMENT_ME, &delete_gtid_domain, sizeof(uint32),
gtid_domain_static_buffer,
initial_gtid_domain_buffer_size,
initial_gtid_domain_buffer_size, 0);

View file

@ -510,11 +510,11 @@ struct LEX_MASTER_INFO
void init()
{
bzero(this, sizeof(*this));
my_init_dynamic_array(&repl_ignore_server_ids, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_ignore_server_ids,
sizeof(::server_id), 0, 16, MYF(0));
my_init_dynamic_array(&repl_do_domain_ids, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_do_domain_ids,
sizeof(ulong), 0, 16, MYF(0));
my_init_dynamic_array(&repl_ignore_domain_ids, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &repl_ignore_domain_ids,
sizeof(ulong), 0, 16, MYF(0));
sql_delay= -1;
}

View file

@ -1608,26 +1608,24 @@ int plugin_init(int *argc, char **argv, int flags)
init_alloc_root(key_memory_plugin_mem_root, &plugin_vars_mem_root, 4096, 4096, MYF(0));
init_alloc_root(PSI_NOT_INSTRUMENTED, &tmp_root, 4096, 4096, MYF(0));
if (my_hash_init(&bookmark_hash, &my_charset_bin, 32, 0, 0,
get_bookmark_hash_key, NULL, HASH_UNIQUE,
key_memory_plugin_bookmark))
if (my_hash_init(key_memory_plugin_bookmark, &bookmark_hash, &my_charset_bin, 32, 0, 0,
get_bookmark_hash_key, NULL, HASH_UNIQUE))
goto err;
/*
The 80 is from 2016-04-27 when we had 71 default plugins
Big enough to avoid many mallocs even in future
*/
if (my_init_dynamic_array(&plugin_dl_array, key_memory_mysql_plugin_dl,
if (my_init_dynamic_array(key_memory_mysql_plugin_dl, &plugin_dl_array,
sizeof(struct st_plugin_dl *), 16, 16, MYF(0)) ||
my_init_dynamic_array(&plugin_array, key_memory_mysql_plugin,
my_init_dynamic_array(key_memory_mysql_plugin, &plugin_array,
sizeof(struct st_plugin_int *), 80, 32, MYF(0)))
goto err;
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
if (my_hash_init(&plugin_hash[i], system_charset_info, 32, 0, 0,
get_plugin_hash_key, NULL, HASH_UNIQUE,
key_memory_plugin_mem_root))
if (my_hash_init(key_memory_plugin_mem_root, &plugin_hash[i], system_charset_info, 32, 0, 0,
get_plugin_hash_key, NULL, HASH_UNIQUE))
goto err;
}

View file

@ -6769,7 +6769,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* set a barrier for the array of SARGABLE_PARAM */
(*sargables)[0].field= 0;
if (my_init_dynamic_array2(keyuse, thd->mem_root->m_psi_key, sizeof(KEYUSE),
if (my_init_dynamic_array2(thd->mem_root->m_psi_key, keyuse, sizeof(KEYUSE),
thd->alloc(sizeof(KEYUSE) * 20), 20, 64,
MYF(MY_THREAD_SPECIFIC)))
DBUG_RETURN(TRUE);
@ -24043,9 +24043,9 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++)
(*field_length++)= (*ptr)->sort_length();
if (my_hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0,
key_length, (my_hash_get_key) 0, 0, 0,
key_memory_hash_index_key_buffer))
if (my_hash_init(key_memory_hash_index_key_buffer, &hash, &my_charset_bin,
(uint) file->stats.records, 0, key_length,
(my_hash_get_key) 0, 0, 0))
{
my_free(key_buffer);
DBUG_RETURN(1);
@ -27856,7 +27856,7 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
reset_query_plan();
if (!keyuse.buffer &&
my_init_dynamic_array(&keyuse, thd->mem_root->m_psi_key, sizeof(KEYUSE),
my_init_dynamic_array(thd->mem_root->m_psi_key, &keyuse, sizeof(KEYUSE),
20, 64, MYF(MY_THREAD_SPECIFIC)))
{
delete_dynamic(&added_keyuse);

View file

@ -158,9 +158,8 @@ bool servers_init(bool dont_read_servers_table)
DBUG_RETURN(TRUE);
/* initialise our servers cache */
if (my_hash_init(&servers_cache, system_charset_info, 32, 0, 0,
(my_hash_get_key) servers_cache_get_key, 0, 0,
key_memory_servers))
if (my_hash_init(key_memory_servers, &servers_cache, system_charset_info, 32, 0, 0,
(my_hash_get_key) servers_cache_get_key, 0, 0))
{
return_val= TRUE; /* we failed, out of memory? */
goto end;

View file

@ -571,7 +571,7 @@ static bool skip_ignored_dir_check= TRUE;
bool
ignore_db_dirs_init()
{
return my_init_dynamic_array(&ignore_db_dirs_array, key_memory_ignored_db,
return my_init_dynamic_array(key_memory_ignored_db, &ignore_db_dirs_array,
sizeof(LEX_STRING *), 0, 0, MYF(0));
}
@ -749,12 +749,10 @@ ignore_db_dirs_process_additions()
skip_ignored_dir_check= TRUE;
if (my_hash_init(&ignore_db_dirs_hash,
lower_case_table_names ?
character_set_filesystem : &my_charset_bin,
0, 0, 0, db_dirs_hash_get_key,
dispose_db_dir,
HASH_UNIQUE, key_memory_ignored_db))
if (my_hash_init(key_memory_ignored_db, &ignore_db_dirs_hash,
lower_case_table_names ? character_set_filesystem :
&my_charset_bin, 0, 0, 0, db_dirs_hash_get_key,
dispose_db_dir, HASH_UNIQUE))
return true;
/* len starts from 1 because of the terminating zero. */
@ -3365,7 +3363,7 @@ int add_status_vars(SHOW_VAR *list)
if (status_vars_inited)
mysql_rwlock_wrlock(&LOCK_all_status_vars);
if (!all_status_vars.buffer && // array is not allocated yet - do it now
my_init_dynamic_array(&all_status_vars, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &all_status_vars,
sizeof(SHOW_VAR), 250, 50, MYF(0)))
{
res= 1;

View file

@ -466,10 +466,9 @@ static void display_table_locks(void)
void *saved_base;
DYNAMIC_ARRAY saved_table_locks;
(void) my_init_dynamic_array(&saved_table_locks,
key_memory_locked_thread_list,
sizeof(TABLE_LOCK_INFO), tc_records() + 20, 50,
MYF(0));
(void) my_init_dynamic_array(key_memory_locked_thread_list,
&saved_table_locks, sizeof(TABLE_LOCK_INFO),
tc_records() + 20, 50, MYF(0));
mysql_mutex_lock(&THR_LOCK_lock);
for (list= thr_lock_thread_list; list; list= list_rest(list))
{

View file

@ -167,8 +167,8 @@ void udf_init()
init_sql_alloc(key_memory_udf_mem, &mem, UDF_ALLOC_BLOCK_SIZE, 0, MYF(0));
THD *new_thd = new THD(0);
if (!new_thd ||
my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0,
key_memory_udf_mem))
my_hash_init(key_memory_udf_mem,
&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))
{
sql_print_error("Can't allocate memory for udf structures");
my_hash_free(&udf_hash);

View file

@ -2198,10 +2198,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
use_hash= share->fields >= MAX_FIELDS_BEFORE_HASH;
if (use_hash)
use_hash= !my_hash_init(&share->name_hash, system_charset_info,
share->fields, 0, 0,
(my_hash_get_key) get_field_name, 0, 0,
PSI_INSTRUMENT_ME);
use_hash= !my_hash_init(PSI_INSTRUMENT_ME, &share->name_hash,
system_charset_info, share->fields, 0, 0,
(my_hash_get_key) get_field_name, 0, 0);
if (share->mysql_version >= 50700 && share->mysql_version < 100000 &&
vcol_screen_length)

View file

@ -1258,8 +1258,9 @@ int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument,
if (no_dups)
{
init_alloc_root(PSI_INSTRUMENT_ME, &no_dups_argument.root, 4096, 4096, MYF(alloc_flags));
my_hash_init(&no_dups_argument.hash, &my_charset_bin, tdc_records(), 0, 0,
eliminate_duplicates_get_key, 0, hash_flags, PSI_INSTRUMENT_ME);
my_hash_init(PSI_INSTRUMENT_ME, &no_dups_argument.hash, &my_charset_bin,
tdc_records(), 0, 0, eliminate_duplicates_get_key, 0,
hash_flags);
no_dups_argument.action= action;
no_dups_argument.argument= argument;
action= (my_hash_walk_action) eliminate_duplicates;

View file

@ -1625,16 +1625,14 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
thd->store_globals();
/* Init all memory structures that require explicit destruction */
if (my_hash_init(&tz_names, &my_charset_latin1, 20,
0, 0, (my_hash_get_key) my_tz_names_get_key, 0, 0,
key_memory_tz_storage))
if (my_hash_init(key_memory_tz_storage, &tz_names, &my_charset_latin1, 20, 0,
0, (my_hash_get_key) my_tz_names_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
goto end;
}
if (my_hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0,
(my_hash_get_key)my_offset_tzs_get_key, 0, 0,
key_memory_tz_storage))
if (my_hash_init(key_memory_tz_storage, &offset_tzs, &my_charset_latin1, 26,
0, 0, (my_hash_get_key)my_offset_tzs_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
my_hash_free(&tz_names);

View file

@ -93,7 +93,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
init_tree(&tree, (max_in_memory_size / 16), 0, size, comp_func,
NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC));
/* If the following fail's the next add will also fail */
my_init_dynamic_array(&file_ptrs, PSI_INSTRUMENT_ME, sizeof(Merge_chunk), 16,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &file_ptrs, sizeof(Merge_chunk), 16,
16, MYF(MY_THREAD_SPECIFIC));
/*
If you change the following, change it in get_max_elements function, too.

View file

@ -403,10 +403,10 @@ static int blackhole_init(void *p)
mysql_mutex_init(bh_key_mutex_blackhole,
&blackhole_mutex, MY_MUTEX_INIT_FAST);
(void) my_hash_init(&blackhole_open_tables, system_charset_info,32,0,0,
(void) my_hash_init(PSI_INSTRUMENT_ME, &blackhole_open_tables,
system_charset_info, 32, 0, 0,
(my_hash_get_key) blackhole_get_key,
(my_hash_free_key) blackhole_free_key, 0,
PSI_INSTRUMENT_ME);
(my_hash_free_key) blackhole_free_key, 0);
return 0;
}

View file

@ -242,8 +242,8 @@ static int cassandra_init_func(void *p)
cassandra_hton= (handlerton *)p;
mysql_mutex_init(ex_key_mutex_example, &cassandra_mutex, MY_MUTEX_INIT_FAST);
(void) my_hash_init(&cassandra_open_tables,system_charset_info,32,0,0,
(my_hash_get_key) cassandra_get_key,0,0, PSI_INSTRUMENT_ME);
(void) my_hash_init(PSI_INSTRUMENT_ME, &cassandra_open_tables,system_charset_info,32,0,0,
(my_hash_get_key) cassandra_get_key,0,0);
cassandra_hton->create= cassandra_create_handler;
/*
@ -1458,12 +1458,12 @@ bool ha_cassandra::setup_field_converters(Field **field_arg, uint n_fields)
special_type_field_names=
((LEX_STRING*)(special_type_field_converters + max_non_default_fields));
if (my_init_dynamic_array(&dynamic_values, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &dynamic_values,
sizeof(DYNAMIC_COLUMN_VALUE),
DYNCOL_USUAL, DYNCOL_DELTA, MYF(0)))
DBUG_RETURN(true);
else
if (my_init_dynamic_array(&dynamic_names, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &dynamic_names,
sizeof(LEX_STRING),
DYNCOL_USUAL, DYNCOL_DELTA,MYF(0)))
{

View file

@ -183,9 +183,9 @@ static int tina_init_func(void *p)
tina_hton= (handlerton *)p;
mysql_mutex_init(csv_key_mutex_tina, &tina_mutex, MY_MUTEX_INIT_FAST);
(void) my_hash_init(&tina_open_tables, system_charset_info, 32, 0, 0,
(my_hash_get_key) tina_get_key, 0, 0,
csv_key_memory_tina_share);
(void) my_hash_init(csv_key_memory_tina_share, &tina_open_tables,
system_charset_info, 32, 0, 0, (my_hash_get_key)
tina_get_key, 0, 0);
tina_hton->db_type= DB_TYPE_CSV_DB;
tina_hton->create= tina_create_handler;
tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES |

View file

@ -496,8 +496,8 @@ int federated_db_init(void *p)
if (mysql_mutex_init(fe_key_mutex_federated,
&federated_mutex, MY_MUTEX_INIT_FAST))
goto error;
if (!my_hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) federated_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (!my_hash_init(PSI_INSTRUMENT_ME, &federated_open_tables, &my_charset_bin,
32, 0, 0, (my_hash_get_key) federated_get_key, 0, 0))
{
DBUG_RETURN(FALSE);
}
@ -1642,7 +1642,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
ref_length= sizeof(MYSQL_RES *) + sizeof(MYSQL_ROW_OFFSET);
DBUG_PRINT("info", ("ref_length: %u", ref_length));
my_init_dynamic_array(&results, PSI_INSTRUMENT_ME, sizeof(MYSQL_RES *), 4, 4, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &results, sizeof(MYSQL_RES *), 4, 4, MYF(0));
reset();
DBUG_RETURN(0);

View file

@ -140,7 +140,7 @@ federatedx_io_mysql::federatedx_io_mysql(FEDERATEDX_SERVER *aserver)
bzero(&mysql, sizeof(MYSQL));
bzero(&savepoints, sizeof(DYNAMIC_ARRAY));
my_init_dynamic_array(&savepoints, PSI_INSTRUMENT_ME, sizeof(SAVEPT), 16, 16, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &savepoints, sizeof(SAVEPT), 16, 16, MYF(0));
DBUG_VOID_RETURN;
}

View file

@ -445,10 +445,10 @@ int federatedx_db_init(void *p)
if (mysql_mutex_init(fe_key_mutex_federatedx,
&federatedx_mutex, MY_MUTEX_INIT_FAST))
goto error;
if (!my_hash_init(&federatedx_open_tables, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) federatedx_share_get_key, 0, 0, PSI_INSTRUMENT_ME) &&
!my_hash_init(&federatedx_open_servers, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) federatedx_server_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (!my_hash_init(PSI_INSTRUMENT_ME, &federatedx_open_tables, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) federatedx_share_get_key, 0, 0) &&
!my_hash_init(PSI_INSTRUMENT_ME, &federatedx_open_servers, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) federatedx_server_get_key, 0, 0))
{
DBUG_RETURN(FALSE);
}
@ -1802,7 +1802,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked)
DBUG_PRINT("info", ("ref_length: %u", ref_length));
my_init_dynamic_array(&results, PSI_INSTRUMENT_ME, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, MYF(0));
my_init_dynamic_array(PSI_INSTRUMENT_ME, &results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, MYF(0));
reset();

View file

@ -239,7 +239,7 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file,
#endif
if (!((bitmap->map= (uchar*) my_malloc(PSI_INSTRUMENT_ME, size, MYF(MY_WME)))) ||
my_init_dynamic_array(&bitmap->pinned_pages, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &bitmap->pinned_pages,
sizeof(MARIA_PINNED_PAGE), 1, 1, MYF(0)))
return 1;

View file

@ -530,7 +530,7 @@ my_bool _ma_init_block_record(MARIA_HA *info)
FULL_PAGE_SIZE(share) /
BLOB_SEGMENT_MIN_SIZE));
if (my_init_dynamic_array(&info->bitmap_blocks, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &info->bitmap_blocks,
sizeof(MARIA_BITMAP_BLOCK), default_extents,
64, MYF(0)))
goto err;

View file

@ -71,11 +71,9 @@ int maria_init(void)
trnman_end_trans_hook= _ma_trnman_end_trans_hook;
maria_create_trn_hook= dummy_maria_create_trn_hook;
}
my_hash_init(&maria_stored_state, &my_charset_bin, 32,
0, sizeof(LSN), 0, (my_hash_free_key) history_state_free, 0,
PSI_INSTRUMENT_ME);
DBUG_PRINT("info",("dummy_transaction_object: %p",
&dummy_transaction_object));
my_hash_init(PSI_INSTRUMENT_ME, &maria_stored_state, &my_charset_bin, 32, 0,
sizeof(LSN), 0, (my_hash_free_key) history_state_free, 0);
DBUG_PRINT("info",("dummy_transaction_object: %p", &dummy_transaction_object));
return 0;
}

View file

@ -3660,9 +3660,9 @@ my_bool translog_init_with_table(const char *directory,
&log_descriptor.new_goal_cond, 0) ||
mysql_rwlock_init(key_TRANSLOG_DESCRIPTOR_open_files_lock,
&log_descriptor.open_files_lock) ||
my_init_dynamic_array(&log_descriptor.open_files, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &log_descriptor.open_files,
sizeof(TRANSLOG_FILE*), 10, 10, MYF(0)) ||
my_init_dynamic_array(&log_descriptor.unfinished_files, PSI_INSTRUMENT_ME,
my_init_dynamic_array(PSI_INSTRUMENT_ME, &log_descriptor.unfinished_files,
sizeof(struct st_file_counter),
10, 10, MYF(0)))
goto err;
@ -5649,7 +5649,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
used_buffs_init(&cursor.buffs);
chunk2_header[0]= TRANSLOG_CHUNK_NOHDR;
if (my_init_dynamic_array(&groups, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &groups,
sizeof(struct st_translog_group_descriptor),
10, 10, MYF(0)))
{

View file

@ -166,7 +166,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share,
goto err;
/* The following should be big enough for all pinning purposes */
if (my_init_dynamic_array(&info.pinned_pages, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &info.pinned_pages,
sizeof(MARIA_PINNED_PAGE),
MY_MAX(share->base.blobs*2 + 4,
MARIA_MAX_TREE_LEVELS*3), 16, MYF(0)))

View file

@ -789,10 +789,10 @@ size_t init_pagecache(PAGECACHE *pagecache, size_t use_mem,
{
if (mysql_mutex_init(key_PAGECACHE_cache_lock,
&pagecache->cache_lock, MY_MUTEX_INIT_FAST) ||
my_hash_init(&pagecache->files_in_flush, &my_charset_bin, 32,
offsetof(struct st_file_in_flush, file),
my_hash_init(PSI_INSTRUMENT_ME, &pagecache->files_in_flush,
&my_charset_bin, 32, offsetof(struct st_file_in_flush, file),
sizeof(((struct st_file_in_flush *)NULL)->file),
NULL, NULL, 0, PSI_INSTRUMENT_ME))
NULL, NULL, 0))
goto err;
pagecache->inited= 1;
pagecache->in_init= 0;

View file

@ -3342,16 +3342,16 @@ static LSN parse_checkpoint_record(LSN lsn)
/* dirty pages */
nb_dirty_pages= uint8korr(ptr);
/* Ensure casts later will not loose significant bits. */
/* Ensure casts later will not lose significant bits. */
DBUG_ASSERT((nb_dirty_pages <= SIZE_T_MAX/sizeof(struct st_dirty_page)) &&
(nb_dirty_pages <= ULONG_MAX));
ptr+= 8;
tprint(tracef, "%lu dirty pages\n", (ulong) nb_dirty_pages);
if (my_hash_init(&all_dirty_pages, &my_charset_bin, (ulong)nb_dirty_pages,
offsetof(struct st_dirty_page, file_and_page_id),
if (my_hash_init(PSI_INSTRUMENT_ME, &all_dirty_pages, &my_charset_bin,
(ulong)nb_dirty_pages, offsetof(struct st_dirty_page, file_and_page_id),
sizeof(((struct st_dirty_page *)NULL)->file_and_page_id),
NULL, NULL, 0, PSI_INSTRUMENT_ME))
NULL, NULL, 0))
return LSN_ERROR;
dirty_pages_pool=
(struct st_dirty_page *)my_malloc(PSI_INSTRUMENT_ME, (size_t)nb_dirty_pages *

View file

@ -198,8 +198,8 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
HA_FT_MAXBYTELEN),
MYF(0)))))
{
if (my_init_dynamic_array(&buffpek, PSI_INSTRUMENT_ME, sizeof(BUFFPEK), maxbuffer,
MY_MIN(maxbuffer/2, 1000), MYF(0)))
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &buffpek, sizeof(BUFFPEK),
maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0)))
{
my_free(sort_keys);
sort_keys= 0;
@ -432,7 +432,7 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param)
((sort_param->keyinfo->flag & HA_FULLTEXT) ?
HA_FT_MAXBYTELEN : 0)), MYF(0))))
{
if (my_init_dynamic_array(&sort_param->buffpek, PSI_INSTRUMENT_ME, sizeof(BUFFPEK),
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, MY_MIN(maxbuffer / 2, 1000), MYF(0)))
{
my_free(sort_keys);

View file

@ -893,7 +893,7 @@ ChangeSet@1.2562, 2008-04-09 07:41:40+02:00, serg@janus.mylan +9 -0
/* Yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(PSI_INSTRUMENT_ME, sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
my_init_dynamic_array(info->ft1_to_ft2, PSI_INSTRUMENT_ME, ft2len, 300,
my_init_dynamic_array(PSI_INSTRUMENT_ME, info->ft1_to_ft2, ft2len, 300,
50, MYF(0));
/*

View file

@ -317,9 +317,8 @@ get_one_option(const struct my_option *opt,
char *pos;
if (!my_hash_inited(&tables_to_redo))
{
my_hash_init2(&tables_to_redo, 16, &my_charset_bin,
16, 0, 0, my_hash_get_string, 0, 0, HASH_UNIQUE,
PSI_INSTRUMENT_ME);
my_hash_init2(PSI_INSTRUMENT_ME, &tables_to_redo, 16, &my_charset_bin,
16, 0, 0, my_hash_get_string, 0, 0, HASH_UNIQUE);
}
do
{

View file

@ -33,7 +33,8 @@ my_bool seq_storage_reader_init(SEQ_STORAGE *seq, const char *file)
seq->pos= 0;
if ((fd= my_fopen(file, O_RDONLY, MYF(MY_WME))) == NULL)
return 1;
if (my_init_dynamic_array(&seq->seq, PSI_NOT_INSTRUMENTED, sizeof(ulong), 10, 10, MYF(0)))
if (my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &seq->seq, sizeof(ulong), 10,
10, MYF(0)))
return 1;
for(;;)

View file

@ -247,15 +247,14 @@
get_key, \
free_element, \
flags) \
my_hash_init(hash, \
my_hash_init(mrn_memory_key, hash, \
charset, \
default_array_elements, \
key_offset, \
key_length, \
get_key, \
free_element, \
flags, \
mrn_memory_key)
flags)
#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100000
# define mrn_strconvert(from_cs, \

View file

@ -548,8 +548,8 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(mi_key_memory_MI_INFO_ft1_to_ft2,
sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
my_init_dynamic_array(info->ft1_to_ft2, mi_key_memory_MI_INFO_ft1_to_ft2,
ft2len, 300, 50, MYF(0));
my_init_dynamic_array(mi_key_memory_MI_INFO_ft1_to_ft2,
info->ft1_to_ft2, ft2len, 300, 50, MYF(0));
/*
now, adding all keys from the page to dynarray

View file

@ -194,9 +194,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
(size_t) (keys*(sort_length+sizeof(char*))+
HA_FT_MAXBYTELEN), MYF(0)))))
{
if (my_init_dynamic_array(&buffpek, PSI_INSTRUMENT_ME,
sizeof(BUFFPEK), maxbuffer,
MY_MIN(maxbuffer/2, 1000), MYF(0)))
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &buffpek, sizeof(BUFFPEK),
maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0)))
{
my_free(sort_keys);
sort_keys= 0;
@ -413,7 +412,7 @@ static my_bool thr_find_all_keys_exec(MI_SORT_PARAM *sort_param)
((sort_param->keyinfo->flag & HA_FULLTEXT) ?
HA_FT_MAXBYTELEN : 0)), MYF(0))))
{
if (my_init_dynamic_array(&sort_param->buffpek, PSI_INSTRUMENT_ME,
if (my_init_dynamic_array(PSI_INSTRUMENT_ME, &sort_param->buffpek,
sizeof(BUFFPEK), maxbuffer,
MY_MIN(maxbuffer / 2, 1000), MYF(0)))
{

View file

@ -738,8 +738,9 @@ static int sphinx_init_func ( void * p )
{
sphinx_init = 1;
void ( pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST ) );
sphinx_hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0,
sphinx_get_key, 0, 0, PSI_NOT_INSTRUMENTED );
sphinx_hash_init ( PSI_NOT_INSTRUMENTED, &sphinx_open_tables,
system_charset_info, 32, 0, 0,
sphinx_get_key, 0, 0 );
#if MYSQL_VERSION_ID > 50100
handlerton * hton = (handlerton*) p;

View file

@ -35,8 +35,8 @@ conf_get_key(
config::config()
{
if (my_hash_init(&conf_hash, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) conf_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &conf_hash, &my_charset_bin, 32, 0, 0,
(my_hash_get_key) conf_get_key, 0, 0))
init = FALSE;
else
init = TRUE;

View file

@ -18,7 +18,7 @@
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100500
#define SPD_INIT_DYNAMIC_ARRAY2(A, B, C, D, E, F) \
my_init_dynamic_array2(A, PSI_INSTRUMENT_ME, B, C, D, E, F)
my_init_dynamic_array2(PSI_INSTRUMENT_ME, A, B, C, D, E, F)
#define SPD_INIT_ALLOC_ROOT(A, B, C, D) \
init_alloc_root(PSI_INSTRUMENT_ME, A, B, C, D)
#elif defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100213

View file

@ -1866,8 +1866,8 @@ int spider_db_mbase::init()
DBUG_ENTER("spider_db_mbase::init");
DBUG_PRINT("info",("spider this=%p", this));
if (
my_hash_init(&lock_table_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_link_get_key, 0, 0, PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &lock_table_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_link_get_key, 0, 0)
) {
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}

View file

@ -6138,9 +6138,8 @@ SPIDER_PARTITION_SHARE *spider_get_pt_share(
}
if(
my_hash_init(&partition_share->pt_handler_hash, spd_charset_utf8mb3_bin,
32, 0, 0, (my_hash_get_key) spider_pt_handler_share_get_key, 0, 0,
PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &partition_share->pt_handler_hash, spd_charset_utf8mb3_bin,
32, 0, 0, (my_hash_get_key) spider_pt_handler_share_get_key, 0, 0)
) {
*error_num = HA_ERR_OUT_OF_MEM;
goto error_init_pt_handler_hash;
@ -7185,8 +7184,8 @@ int spider_db_init(
#endif
goto error_mem_calc_mutex_init;
if (my_hash_init(&spider_open_tables, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_tbl_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_open_tables, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_tbl_get_key, 0, 0))
goto error_open_tables_hash_init;
spider_alloc_calc_mem_init(spider_open_tables, 143);
@ -7194,8 +7193,8 @@ int spider_db_init(
spider_open_tables,
spider_open_tables.array.max_element *
spider_open_tables.array.size_of_element);
if (my_hash_init(&spider_init_error_tables, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_tbl_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_init_error_tables, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_tbl_get_key, 0, 0))
goto error_init_error_tables_hash_init;
spider_alloc_calc_mem_init(spider_init_error_tables, 144);
@ -7204,8 +7203,8 @@ int spider_db_init(
spider_init_error_tables.array.max_element *
spider_init_error_tables.array.size_of_element);
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (my_hash_init(&spider_open_pt_share, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_pt_share_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_open_pt_share, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_pt_share_get_key, 0, 0))
goto error_open_pt_share_hash_init;
spider_alloc_calc_mem_init(spider_open_pt_share, 145);
@ -7214,10 +7213,9 @@ int spider_db_init(
spider_open_pt_share.array.max_element *
spider_open_pt_share.array.size_of_element);
#endif
if (my_hash_init(&spider_lgtm_tblhnd_share_hash, spd_charset_utf8mb3_bin,
32, 0, 0,
(my_hash_get_key) spider_lgtm_tblhnd_share_hash_get_key,
0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_lgtm_tblhnd_share_hash,
spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_lgtm_tblhnd_share_hash_get_key, 0, 0))
goto error_lgtm_tblhnd_share_hash_init;
spider_alloc_calc_mem_init(spider_lgtm_tblhnd_share_hash, 245);
@ -7225,13 +7223,13 @@ int spider_db_init(
spider_lgtm_tblhnd_share_hash,
spider_lgtm_tblhnd_share_hash.array.max_element *
spider_lgtm_tblhnd_share_hash.array.size_of_element);
if (my_hash_init(&spider_open_connections, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_open_connections, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0))
goto error_open_connections_hash_init;
if (my_hash_init(&spider_ipport_conns, spd_charset_utf8mb3_bin, 32, 0, 0,
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_ipport_conns, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_ipport_conn_get_key,
spider_free_ipport_conn, 0, PSI_INSTRUMENT_ME))
spider_free_ipport_conn, 0))
goto error_ipport_conn__hash_init;
spider_alloc_calc_mem_init(spider_open_connections, 146);
@ -7240,8 +7238,8 @@ int spider_db_init(
spider_open_connections.array.max_element *
spider_open_connections.array.size_of_element);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (my_hash_init(&spider_hs_r_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_hs_r_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0))
goto error_hs_r_conn_hash_init;
spider_alloc_calc_mem_init(spider_hs_r_conn_hash, 147);
@ -7249,8 +7247,8 @@ int spider_db_init(
spider_hs_r_conn_hash,
spider_hs_r_conn_hash.array.max_element *
spider_hs_r_conn_hash.array.size_of_element);
if (my_hash_init(&spider_hs_w_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_hs_w_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0))
goto error_hs_w_conn_hash_init;
spider_alloc_calc_mem_init(spider_hs_w_conn_hash, 148);
@ -7259,8 +7257,8 @@ int spider_db_init(
spider_hs_w_conn_hash.array.max_element *
spider_hs_w_conn_hash.array.size_of_element);
#endif
if (my_hash_init(&spider_allocated_thds, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_allocated_thds_get_key, 0, 0, PSI_INSTRUMENT_ME))
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_allocated_thds, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_allocated_thds_get_key, 0, 0))
goto error_allocated_thds_hash_init;
spider_alloc_calc_mem_init(spider_allocated_thds, 149);
@ -7320,9 +7318,9 @@ int spider_db_init(
roop_count < (int) spider_param_udf_table_mon_mutex_count();
roop_count++)
{
if (my_hash_init(&spider_udf_table_mon_list_hash[roop_count],
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_udf_table_mon_list_hash[roop_count],
spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_udf_tbl_mon_list_key, 0, 0, PSI_INSTRUMENT_ME))
(my_hash_get_key) spider_udf_tbl_mon_list_key, 0, 0))
goto error_init_udf_table_mon_list_hash;
spider_alloc_calc_mem_init(spider_udf_table_mon_list_hash, 150);

View file

@ -1237,8 +1237,9 @@ SPIDER_TRX *spider_get_trx(
}
if (
my_hash_init(&trx->trx_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0, PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &trx->trx_conn_hash,
spd_charset_utf8mb3_bin, 32, 0, 0, (my_hash_get_key)
spider_conn_get_key, 0, 0)
)
goto error_init_hash;
spider_alloc_calc_mem_init(trx->trx_conn_hash, 151);
@ -1249,8 +1250,9 @@ SPIDER_TRX *spider_get_trx(
trx->trx_conn_hash.array.size_of_element);
if (
my_hash_init(&trx->trx_another_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_conn_get_key, 0, 0, PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &trx->trx_another_conn_hash,
spd_charset_utf8mb3_bin, 32, 0, 0, (my_hash_get_key)
spider_conn_get_key, 0, 0)
)
goto error_init_another_hash;
spider_alloc_calc_mem_init(trx->trx_another_conn_hash, 152);
@ -1313,8 +1315,9 @@ SPIDER_TRX *spider_get_trx(
#endif
if (
my_hash_init(&trx->trx_alter_table_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_alter_tbl_get_key, 0, 0, PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &trx->trx_alter_table_hash,
spd_charset_utf8mb3_bin, 32, 0, 0, (my_hash_get_key)
spider_alter_tbl_get_key, 0, 0)
)
goto error_init_alter_hash;
spider_alloc_calc_mem_init(trx->trx_alter_table_hash, 157);
@ -1325,8 +1328,9 @@ SPIDER_TRX *spider_get_trx(
trx->trx_alter_table_hash.array.size_of_element);
if (
my_hash_init(&trx->trx_ha_hash, spd_charset_utf8mb3_bin, 32, 0, 0,
(my_hash_get_key) spider_trx_ha_get_key, 0, 0, PSI_INSTRUMENT_ME)
my_hash_init(PSI_INSTRUMENT_ME, &trx->trx_ha_hash,
spd_charset_utf8mb3_bin, 32, 0, 0, (my_hash_get_key)
spider_trx_ha_get_key, 0, 0)
)
goto error_init_trx_ha_hash;
spider_alloc_calc_mem_init(trx->trx_ha_hash, 158);