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

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