mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Backport of:
---------------------------------------------------------- revno: 2617.22.5 committer: Konstantin Osipov <kostja@sun.com> branch nick: mysql-6.0-runtime timestamp: Tue 2009-01-27 05:08:48 +0300 message: Remove non-prefixed use of HASH. Always use my_hash_init(), my_hash_inited(), my_hash_search(), my_hash_element(), my_hash_delete(), my_hash_free() rather than non-prefixed counterparts (hash_init(), etc). Remove the backward-compatible defines.
This commit is contained in:
@@ -574,14 +574,15 @@ static struct st_plugin_int *plugin_find_internal(const LEX_STRING *name, int ty
|
||||
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
|
||||
{
|
||||
struct st_plugin_int *plugin= (st_plugin_int *)
|
||||
hash_search(&plugin_hash[i], (const uchar *)name->str, name->length);
|
||||
my_hash_search(&plugin_hash[i], (const uchar *)name->str, name->length);
|
||||
if (plugin)
|
||||
DBUG_RETURN(plugin);
|
||||
}
|
||||
}
|
||||
else
|
||||
DBUG_RETURN((st_plugin_int *)
|
||||
hash_search(&plugin_hash[type], (const uchar *)name->str, name->length));
|
||||
my_hash_search(&plugin_hash[type], (const uchar *)name->str,
|
||||
name->length));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -858,7 +859,7 @@ static void plugin_del(struct st_plugin_int *plugin)
|
||||
safe_mutex_assert_owner(&LOCK_plugin);
|
||||
/* Free allocated strings before deleting the plugin. */
|
||||
plugin_vars_free_values(plugin->system_vars);
|
||||
hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin);
|
||||
my_hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin);
|
||||
if (plugin->plugin_dl)
|
||||
plugin_dl_del(&plugin->plugin_dl->dl);
|
||||
plugin->state= PLUGIN_IS_FREED;
|
||||
@@ -1133,8 +1134,8 @@ int plugin_init(int *argc, char **argv, int flags)
|
||||
init_alloc_root(&plugin_mem_root, 4096, 4096);
|
||||
init_alloc_root(&tmp_root, 4096, 4096);
|
||||
|
||||
if (hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
|
||||
get_bookmark_hash_key, NULL, HASH_UNIQUE))
|
||||
if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
|
||||
get_bookmark_hash_key, NULL, HASH_UNIQUE))
|
||||
goto err;
|
||||
|
||||
|
||||
@@ -1148,8 +1149,8 @@ int plugin_init(int *argc, char **argv, int flags)
|
||||
|
||||
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
|
||||
{
|
||||
if (hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
|
||||
get_plugin_hash_key, NULL, HASH_UNIQUE))
|
||||
if (my_hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
|
||||
get_plugin_hash_key, NULL, HASH_UNIQUE))
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1627,7 +1628,7 @@ void plugin_shutdown(void)
|
||||
/* Dispose of the memory */
|
||||
|
||||
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
|
||||
hash_free(&plugin_hash[i]);
|
||||
my_hash_free(&plugin_hash[i]);
|
||||
delete_dynamic(&plugin_array);
|
||||
|
||||
count= plugin_dl_array.elements;
|
||||
@@ -1639,7 +1640,7 @@ void plugin_shutdown(void)
|
||||
my_afree(dl);
|
||||
delete_dynamic(&plugin_dl_array);
|
||||
|
||||
hash_free(&bookmark_hash);
|
||||
my_hash_free(&bookmark_hash);
|
||||
free_root(&plugin_mem_root, MYF(0));
|
||||
|
||||
global_variables_dynamic_size= 0;
|
||||
@@ -1827,7 +1828,7 @@ bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
|
||||
HASH *hash= plugin_hash + type;
|
||||
for (idx= 0; idx < total; idx++)
|
||||
{
|
||||
plugin= (struct st_plugin_int *) hash_element(hash, idx);
|
||||
plugin= (struct st_plugin_int *) my_hash_element(hash, idx);
|
||||
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
|
||||
}
|
||||
}
|
||||
@@ -2226,8 +2227,8 @@ static st_bookmark *find_bookmark(const char *plugin, const char *name,
|
||||
|
||||
varname[0]= flags & PLUGIN_VAR_TYPEMASK;
|
||||
|
||||
result= (st_bookmark*) hash_search(&bookmark_hash,
|
||||
(const uchar*) varname, length - 1);
|
||||
result= (st_bookmark*) my_hash_search(&bookmark_hash,
|
||||
(const uchar*) varname, length - 1);
|
||||
|
||||
my_afree(varname);
|
||||
return result;
|
||||
@@ -2387,7 +2388,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
|
||||
{
|
||||
sys_var_pluginvar *pi;
|
||||
sys_var *var;
|
||||
st_bookmark *v= (st_bookmark*) hash_element(&bookmark_hash,idx);
|
||||
st_bookmark *v= (st_bookmark*) my_hash_element(&bookmark_hash,idx);
|
||||
|
||||
if (v->version <= thd->variables.dynamic_variables_version ||
|
||||
!(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
|
||||
@@ -2481,7 +2482,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars)
|
||||
rw_rdlock(&LOCK_system_variables_hash);
|
||||
for (idx= 0; idx < bookmark_hash.records; idx++)
|
||||
{
|
||||
v= (st_bookmark*) hash_element(&bookmark_hash, idx);
|
||||
v= (st_bookmark*) my_hash_element(&bookmark_hash, idx);
|
||||
if (v->version > vars->dynamic_variables_version ||
|
||||
!(var= intern_find_sys_var(v->key + 1, v->name_len, true)) ||
|
||||
!(pivar= var->cast_pluginvar()) ||
|
||||
|
Reference in New Issue
Block a user