Replace skygw_ type prefix with qc_.

- skygw_query_type_t renamed to qc_query_type_t.
- skygw_query_op_t renamed to qc_query_op_t.
This commit is contained in:
Johan Wikman
2016-01-11 11:22:38 +02:00
parent 2f42246880
commit 23a7562d3a
7 changed files with 73 additions and 76 deletions

View File

@ -195,7 +195,7 @@ typedef struct rule_t
void* data; /*< Actual implementation of the rule */
char* name; /*< Name of the rule */
ruletype_t type; /*< Type of the rule */
skygw_query_op_t on_queries; /*< Types of queries to inspect */
qc_query_op_t on_queries; /*< Types of queries to inspect */
bool allow; /*< Allow or deny the query if this rule matches */
int times_matched; /*< Number of times this rule has been matched */
TIMERANGE* active; /*< List of times when this rule is active */
@ -1595,7 +1595,7 @@ bool rule_matches(FW_INSTANCE* my_instance,
unsigned char* memptr = (unsigned char*) queue->start;
bool is_sql, is_real, matches;
skygw_query_op_t optype = QUERY_OP_UNDEFINED;
qc_query_op_t optype = QUERY_OP_UNDEFINED;
STRLINK* strln = NULL;
QUERYSPEED* queryspeed = NULL;
QUERYSPEED* rule_qs = NULL;

View File

@ -103,26 +103,26 @@ static backend_ref_t* get_bref_from_dcb(ROUTER_CLIENT_SES* rses, DCB* dcb);
static DCB* rses_get_client_dcb(ROUTER_CLIENT_SES* rses);
static route_target_t get_route_target (
skygw_query_type_t qtype,
bool trx_active,
bool load_active,
target_t use_sql_variables_in,
HINT* hint);
qc_query_type_t qtype,
bool trx_active,
bool load_active,
target_t use_sql_variables_in,
HINT* hint);
static backend_ref_t* check_candidate_bref(
backend_ref_t* candidate_bref,
backend_ref_t* new_bref,
select_criteria_t sc);
static skygw_query_type_t is_read_tmp_table(
static qc_query_type_t is_read_tmp_table(
ROUTER_CLIENT_SES* router_cli_ses,
GWBUF* querybuf,
skygw_query_type_t type);
qc_query_type_t type);
static void check_create_tmp_table(
ROUTER_CLIENT_SES* router_cli_ses,
GWBUF* querybuf,
skygw_query_type_t type);
qc_query_type_t type);
static bool route_single_stmt(
ROUTER_INSTANCE* inst,
@ -276,7 +276,7 @@ static bool route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype);
qc_query_type_t qtype);
static void refreshInstance(
ROUTER_INSTANCE* router,
@ -1370,11 +1370,11 @@ static backend_ref_t* check_candidate_bref(
* if the query would otherwise be routed to slave.
*/
static route_target_t get_route_target (
skygw_query_type_t qtype,
bool trx_active,
bool load_active,
target_t use_sql_variables_in,
HINT* hint)
qc_query_type_t qtype,
bool trx_active,
bool load_active,
target_t use_sql_variables_in,
HINT* hint)
{
route_target_t target = TARGET_UNDEFINED;
/**
@ -1559,7 +1559,7 @@ static route_target_t get_route_target (
void check_drop_tmp_table(
ROUTER_CLIENT_SES* router_cli_ses,
GWBUF* querybuf,
skygw_query_type_t type)
qc_query_type_t type)
{
int tsize = 0, klen = 0,i;
@ -1644,10 +1644,10 @@ void check_drop_tmp_table(
* @param type The type of the query resolved so far
* @return The type of the query
*/
static skygw_query_type_t is_read_tmp_table(
static qc_query_type_t is_read_tmp_table(
ROUTER_CLIENT_SES* router_cli_ses,
GWBUF* querybuf,
skygw_query_type_t type)
qc_query_type_t type)
{
bool target_tmp_table = false;
@ -1657,9 +1657,9 @@ static skygw_query_type_t is_read_tmp_table(
char hkey[MYSQL_DATABASE_MAXLEN+MYSQL_TABLE_MAXLEN+2];
MYSQL_session* data;
DCB* master_dcb = NULL;
skygw_query_type_t qtype = type;
rses_property_t* rses_prop_tmp;
DCB* master_dcb = NULL;
qc_query_type_t qtype = type;
rses_property_t* rses_prop_tmp;
if(router_cli_ses == NULL || querybuf == NULL)
{
@ -1752,7 +1752,7 @@ static skygw_query_type_t is_read_tmp_table(
static void check_create_tmp_table(
ROUTER_CLIENT_SES* router_cli_ses,
GWBUF* querybuf,
skygw_query_type_t type)
qc_query_type_t type)
{
if (!QUERY_IS_TYPE(type, QUERY_TYPE_CREATE_TMP_TABLE))
{
@ -2075,7 +2075,7 @@ static bool route_single_stmt(
ROUTER_CLIENT_SES* rses,
GWBUF* querybuf)
{
skygw_query_type_t qtype = QUERY_TYPE_UNKNOWN;
qc_query_type_t qtype = QUERY_TYPE_UNKNOWN;
mysql_server_cmd_t packet_type = MYSQL_COM_UNDEFINED;
uint8_t* packet;
size_t packet_len;
@ -2195,7 +2195,7 @@ static bool route_single_stmt(
*/
if (!rses->rses_load_active)
{
skygw_query_op_t queryop = qc_get_operation(querybuf);
qc_query_op_t queryop = qc_get_operation(querybuf);
if (queryop == QUERY_OP_LOAD)
{
rses->rses_load_active = true;
@ -4341,7 +4341,7 @@ static bool route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype)
qc_query_type_t qtype)
{
bool succp;
rses_property_t* prop;

View File

@ -95,9 +95,9 @@ static int router_get_servercount(ROUTER_INSTANCE* router);
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,
HINT* hint);
qc_query_type_t qtype,
bool trx_active,
HINT* hint);
static int getCapabilities ();
@ -192,7 +192,7 @@ static bool route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype);
qc_query_type_t qtype);
static void bref_clear_state(backend_ref_t* bref, bref_state_t state);
static void bref_set_state(backend_ref_t* bref, bref_state_t state);
@ -515,7 +515,7 @@ int gen_databaselist(ROUTER_INSTANCE* inst, ROUTER_CLIENT_SES* session)
* @param buffer Query to inspect
* @return Name of the backend or NULL if the query contains no known databases.
*/
char* get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF* buffer,skygw_query_type_t qtype)
char* get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF* buffer,qc_query_type_t qtype)
{
int sz = 0,i,j;
char** dbnms = NULL;
@ -1481,9 +1481,9 @@ return_succp:
* if the query would otherwise be routed to slave.
*/
static route_target_t get_shard_route_target (
skygw_query_type_t qtype,
bool trx_active, /*< !!! turha ? */
HINT* hint) /*< !!! turha ? */
qc_query_type_t qtype,
bool trx_active, /*< !!! turha ? */
HINT* hint) /*< !!! turha ? */
{
route_target_t target = TARGET_UNDEFINED;
@ -1520,11 +1520,10 @@ static route_target_t get_shard_route_target (
* @param querybuf GWBUF containing the query
* @param type The type of the query resolved so far
*/
void check_drop_tmp_table(
ROUTER* instance,
void* router_session,
GWBUF* querybuf,
skygw_query_type_t type)
void check_drop_tmp_table(ROUTER* instance,
void* router_session,
GWBUF* querybuf,
qc_query_type_t type)
{
int tsize = 0, klen = 0,i;
@ -1575,11 +1574,10 @@ ROUTER* instance,
* @param type The type of the query resolved so far
* @return The type of the query
*/
skygw_query_type_t is_read_tmp_table(
ROUTER* instance,
void* router_session,
GWBUF* querybuf,
skygw_query_type_t type)
qc_query_type_t is_read_tmp_table(ROUTER* instance,
void* router_session,
GWBUF* querybuf,
qc_query_type_t type)
{
bool target_tmp_table = false;
@ -1588,7 +1586,7 @@ ROUTER* instance,
char *hkey,*dbname;
ROUTER_CLIENT_SES* router_cli_ses = (ROUTER_CLIENT_SES *)router_session;
skygw_query_type_t qtype = type;
qc_query_type_t qtype = type;
rses_property_t* rses_prop_tmp;
rses_prop_tmp = router_cli_ses->rses_properties[RSES_PROP_TYPE_TMPTABLES];
@ -1654,11 +1652,10 @@ ROUTER* instance,
* @param querybuf GWBUF containing the query
* @param type The type of the query resolved so far
*/
void check_create_tmp_table(
ROUTER* instance,
void* router_session,
GWBUF* querybuf,
skygw_query_type_t type)
void check_create_tmp_table(ROUTER* instance,
void* router_session,
GWBUF* querybuf,
qc_query_type_t type)
{
int klen = 0;
@ -1866,7 +1863,7 @@ static int routeQuery(
void* router_session,
GWBUF* qbuf)
{
skygw_query_type_t qtype = QUERY_TYPE_UNKNOWN;
qc_query_type_t qtype = QUERY_TYPE_UNKNOWN;
mysql_server_cmd_t packet_type;
uint8_t* packet;
int i,ret = 0;
@ -2066,7 +2063,7 @@ static int routeQuery(
* all of them.
*/
skygw_query_op_t op = qc_get_operation(querybuf);
qc_query_op_t op = qc_get_operation(querybuf);
if (packet_type == MYSQL_COM_INIT_DB ||
op == QUERY_OP_CHANGE_DB)
@ -3748,7 +3745,7 @@ static bool route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype)
qc_query_type_t qtype)
{
bool succp = false;
rses_property_t* prop;

View File

@ -112,7 +112,7 @@ static int router_get_servercount(ROUTER_INSTANCE* router);
static route_target_t get_shard_route_target(
skygw_query_type_t qtype,
qc_query_type_t qtype,
bool trx_active,
HINT* hint);
@ -197,7 +197,7 @@ static bool route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype);
qc_query_type_t qtype);
static void refreshInstance(
ROUTER_INSTANCE* router,
@ -438,7 +438,7 @@ gen_subsvc_dblist(ROUTER_INSTANCE* inst, ROUTER_CLIENT_SES* session)
* @return Name of the backend or NULL if the query contains no known databases.
*/
char*
get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF* buffer, skygw_query_type_t qtype)
get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF* buffer, qc_query_type_t qtype)
{
HASHTABLE* ht = client->dbhash;
int sz = 0, i, j;
@ -1275,7 +1275,7 @@ freeSession(
* if the query would otherwise be routed to slave.
*/
static route_target_t
get_shard_route_target(skygw_query_type_t qtype,
get_shard_route_target(qc_query_type_t qtype,
bool trx_active, /*< !!! turha ? */
HINT* hint) /*< !!! turha ? */
{
@ -1483,7 +1483,7 @@ routeQuery(ROUTER* instance,
void* router_session,
GWBUF* querybuf)
{
skygw_query_type_t qtype = QUERY_TYPE_UNKNOWN;
qc_query_type_t qtype = QUERY_TYPE_UNKNOWN;
mysql_server_cmd_t packet_type;
uint8_t* packet;
int i,ret = 1;
@ -2524,7 +2524,7 @@ route_session_write(
GWBUF* querybuf,
ROUTER_INSTANCE* inst,
unsigned char packet_type,
skygw_query_type_t qtype)
qc_query_type_t qtype)
{
bool succp;
rses_property_t* prop;