mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
post-review fixes + cleanup + some minor fixes
This commit is contained in:
@@ -151,12 +151,15 @@ int Instance_map::flush_instances()
|
||||
{
|
||||
int rc;
|
||||
|
||||
guardian->lock();
|
||||
pthread_mutex_lock(&LOCK_instance_map);
|
||||
hash_free(&hash);
|
||||
hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
|
||||
get_instance_key, delete_instance, 0);
|
||||
pthread_mutex_unlock(&LOCK_instance_map);
|
||||
rc= load();
|
||||
guardian->init();
|
||||
guardian->unlock();
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -183,6 +186,7 @@ int Instance_map::complete_initialization()
|
||||
Instance *instance;
|
||||
uint i= 0;
|
||||
|
||||
|
||||
if (hash.records == 0) /* no instances found */
|
||||
{
|
||||
if ((instance= new Instance) == 0)
|
||||
@@ -191,6 +195,7 @@ int Instance_map::complete_initialization()
|
||||
if (instance->init("mysqld") || add_instance(instance))
|
||||
goto err_instance;
|
||||
|
||||
|
||||
/*
|
||||
After an instance have been added to the instance_map,
|
||||
hash_free should handle it's deletion => goto err, not
|
||||
@@ -227,6 +232,7 @@ int Instance_map::load()
|
||||
const char *argv_options[3];
|
||||
char **argv= (char **) &argv_options;
|
||||
|
||||
|
||||
/* the name of the program may be orbitrary here in fact */
|
||||
argv_options[0]= "mysqlmanager";
|
||||
if (first_option != NULL)
|
||||
|
||||
Reference in New Issue
Block a user