Removed all references to use_sql_variables_in variable where it is used in dbshard.

Commented out dead code.
Fixed some indentations.
This commit is contained in:
VilhoRaatikka
2014-12-16 14:14:57 +02:00
parent ef94b7ee54
commit f861d67b7f
3 changed files with 54 additions and 58 deletions

View File

@ -465,6 +465,7 @@ int error_count = 0;
param = config_get_param(
obj->parameters,
"ignore_databases");
if (param == NULL)
{
succp = false;
@ -473,13 +474,13 @@ int error_count = 0;
{
param->qfd.valstr = strdup(param->value);
param->qfd_param_type = STRING_TYPE;
succp = service_set_param_value(obj->element,
succp = service_set_param_value(
obj->element,
param,
ignore_databases,
COUNT_NONE,
STRING_TYPE);
}
}
if (!succp)
@ -498,10 +499,8 @@ int error_count = 0;
LOGIF(LE, (skygw_log_write(
LOGFILE_ERROR,
"Error : parameter was NULL")));
}
}
}
/** Parameters for rwsplit router only */
if (is_rwsplit)

View File

@ -764,14 +764,14 @@ int log_no_master = 1;
if (!(root_master->mon_prev_status & SERVER_STALE_STATUS) && !(root_master->server->status & SERVER_MAINT)) {
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,
"Info: A Master Server is now available: %s:%i",
"Info : A Master Server is now available: %s:%i",
root_master->server->name,
root_master->server->port)));
}
} else {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error: No Master can be determined. Last known was %s:%i",
"Error : No Master can be determined. Last known was %s:%i",
root_master->server->name,
root_master->server->port)));
}
@ -780,7 +780,7 @@ int log_no_master = 1;
if (!root_master && log_no_master) {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error: No Master can be determined")));
"Error : No Master can be determined")));
log_no_master = 0;
}
}

View File

@ -101,7 +101,6 @@ static backend_ref_t* get_bref_from_dcb(ROUTER_CLIENT_SES* rses, DCB* dcb);
static route_target_t get_shard_route_target (
skygw_query_type_t qtype,
bool trx_active,
target_t use_sql_variables_in,
HINT* hint);
#if 0
static backend_ref_t* check_candidate_bref(
@ -236,10 +235,11 @@ static void tracelog_routed_query(
backend_ref_t* bref,
GWBUF* buf);
#if defined(NOT_USED) /*< Not needed but left as an example */
static void dbshard_process_router_options(
ROUTER_INSTANCE* router,
char** options);
#endif
static bool route_session_write(
ROUTER_CLIENT_SES* router_client_ses,
@ -773,7 +773,7 @@ static void refreshInstance(
router->ignore_list = tokenize_string(param->qfd.valstr);
}
}
#if defined(NOT_USED) /*< This is kept as an example if such parameter is processed later */
else if (paramtype == SQLVAR_TARGET_TYPE)
{
if (strncmp(param->name,
@ -791,7 +791,7 @@ static void refreshInstance(
}
}
}
#endif
if (refresh_single)
{
break;
@ -1423,7 +1423,6 @@ static backend_ref_t* check_candidate_bref(
static route_target_t get_shard_route_target (
skygw_query_type_t qtype,
bool trx_active, /*< !!! turha ? */
target_t use_sql_variables_in, /*< 'master' == single tässä tapauksessa */
HINT* hint) /*< !!! turha ? */
{
route_target_t target = TARGET_UNDEFINED;
@ -1443,8 +1442,7 @@ static route_target_t get_shard_route_target (
target = TARGET_ALL;
}
else if(QUERY_IS_TYPE(qtype, QUERY_TYPE_SYSVAR_READ) ||
(use_sql_variables_in == TYPE_ALL &&
QUERY_IS_TYPE(qtype, QUERY_TYPE_GSYSVAR_READ)))
QUERY_IS_TYPE(qtype, QUERY_TYPE_GSYSVAR_READ))
{
target = TARGET_ANY;
}
@ -1732,12 +1730,12 @@ GWBUF* gen_show_dbs_response(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client)
char eof[9] = { 0x05,0x00,0x00,
0x03,0xfe,0x00,
0x00,0x22,0x00 };
#if defined(NOT_USED)
char ok_packet[11] = { 0x07,0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,
0x00,0x00 };
#endif
coldef_len = sizeof(catalog) + strlen(schema) + 1 +
strlen(table) + 1 +
@ -2132,15 +2130,12 @@ static int routeQuery(
}
else
{
/**
* The query targets something else than a shard.
*/
route_target = get_shard_route_target(qtype,
router_cli_ses->rses_transaction_active,
router_cli_ses->rses_config.rw_use_sql_variables_in,
querybuf->hint);
}
@ -4439,6 +4434,7 @@ static backend_ref_t* get_root_master_bref(
#endif
#if defined(NOT_USED) /*< THis isn't needed at the moment but left as an example */
static void dbshard_process_router_options(
ROUTER_INSTANCE* router,
char** options)
@ -4491,6 +4487,7 @@ static void dbshard_process_router_options(
}
} /*< for */
}
#endif /*< NOT_USED */
/**
* Read new database nbame from MYSQL_COM_INIT_DB packet, check that it exists