Merge branch 'develop' into MXS-329-develop-20151111
This commit is contained in:
@ -580,6 +580,7 @@ char task_name[BLRM_TASK_NAME_LEN+1] = "";
|
||||
inst->service->name)));
|
||||
if (service->users) {
|
||||
users_free(service->users);
|
||||
service->users = NULL;
|
||||
}
|
||||
|
||||
free(inst);
|
||||
@ -658,6 +659,7 @@ char task_name[BLRM_TASK_NAME_LEN+1] = "";
|
||||
|
||||
if (service->users) {
|
||||
users_free(service->users);
|
||||
service->users = NULL;
|
||||
}
|
||||
|
||||
if (service->dbref && service->dbref->server) {
|
||||
|
@ -86,8 +86,6 @@ return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char** arg_vector;
|
||||
int arg_count = 1;
|
||||
ROUTER_INSTANCE *inst;
|
||||
int fd;
|
||||
int ret;
|
||||
@ -126,21 +124,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
num_args = optind;
|
||||
|
||||
arg_vector = malloc(sizeof(char*)*(arg_count + 1));
|
||||
mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
|
||||
|
||||
if(arg_vector == NULL)
|
||||
{
|
||||
fprintf(stderr,"Error: Memory allocation failed for log manager arg_vector.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
arg_vector[0] = "logmanager";
|
||||
arg_vector[1] = NULL;
|
||||
skygw_logmanager_init(NULL, arg_count, arg_vector);
|
||||
|
||||
skygw_log_set_augmentation(0);
|
||||
|
||||
free(arg_vector);
|
||||
mxs_log_set_augmentation(0);
|
||||
|
||||
if (!debug_out)
|
||||
skygw_log_disable(LOGFILE_DEBUG);
|
||||
@ -151,8 +137,8 @@ int main(int argc, char **argv) {
|
||||
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||
"Error: Memory allocation failed for ROUTER_INSTANCE")));
|
||||
|
||||
skygw_log_sync_all();
|
||||
skygw_logmanager_done();
|
||||
mxs_log_flush_sync();
|
||||
mxs_log_finish();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -175,8 +161,8 @@ int main(int argc, char **argv) {
|
||||
"Failed to open binlog file %s: %s",
|
||||
path, strerror(errno))));
|
||||
|
||||
skygw_log_sync_all();
|
||||
skygw_logmanager_done();
|
||||
mxs_log_flush_sync();
|
||||
mxs_log_finish();
|
||||
|
||||
free(inst);
|
||||
|
||||
@ -208,13 +194,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
close(inst->binlog_fd);
|
||||
|
||||
skygw_log_sync_all();
|
||||
mxs_log_flush_sync();
|
||||
|
||||
LOGIF(LM, (skygw_log_write_flush(LOGFILE_MESSAGE,
|
||||
"Check retcode: %i, Binlog Pos = %llu", ret, inst->binlog_position)));
|
||||
|
||||
skygw_log_sync_all();
|
||||
skygw_logmanager_done();
|
||||
mxs_log_flush_sync();
|
||||
mxs_log_finish();
|
||||
|
||||
free(inst);
|
||||
|
||||
|
@ -73,11 +73,9 @@ static struct option long_options[] = {
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char** arg_vector;
|
||||
ROUTER_INSTANCE *inst;
|
||||
int ret;
|
||||
int rc;
|
||||
int arg_count = 1;
|
||||
char error_string[BINLOG_ERROR_MSG_LEN + 1] = "";
|
||||
CHANGE_MASTER_OPTIONS change_master;
|
||||
char query[255+1]="";
|
||||
@ -91,18 +89,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
roptions = strdup("server-id=3,heartbeat=200,binlogdir=/not_exists/my_dir,transaction_safety=1,master_version=5.6.99-common,master_hostname=common_server,master_uuid=xxx-fff-cccc-fff,master-id=999");
|
||||
|
||||
arg_vector = malloc(sizeof(char*)*(arg_count + 1));
|
||||
|
||||
if(arg_vector == NULL)
|
||||
{
|
||||
fprintf(stderr,"Error: Memory allocation FAILED for log manager arg_vector.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
arg_vector[0] = "logmanager";
|
||||
arg_vector[1] = NULL;
|
||||
skygw_logmanager_init(NULL, arg_count,arg_vector);
|
||||
free(arg_vector);
|
||||
mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
|
||||
|
||||
skygw_log_disable(LOGFILE_DEBUG);
|
||||
skygw_log_disable(LOGFILE_TRACE);
|
||||
@ -140,8 +127,8 @@ int main(int argc, char **argv) {
|
||||
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||
"Error: Memory allocation FAILED for ROUTER_INSTANCE")));
|
||||
|
||||
skygw_log_sync_all();
|
||||
skygw_logmanager_done();
|
||||
mxs_log_flush_sync();
|
||||
mxs_log_finish();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -591,8 +578,8 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
skygw_log_sync_all();
|
||||
skygw_logmanager_done();
|
||||
mxs_log_flush_sync();
|
||||
mxs_log_finish();
|
||||
|
||||
free(inst);
|
||||
|
||||
|
Reference in New Issue
Block a user