getCapabilities no longer takes arguments and returns an int.
This commit is contained in:
@ -14,7 +14,7 @@ add_executable(test_users testusers.c)
|
||||
add_executable(test_adminusers testadminusers.c)
|
||||
add_executable(testmemlog testmemlog.c ../random_jkiss.c)
|
||||
add_executable(testfeedback testfeedback.c)
|
||||
add_executable(testmaxscalepcre2 testmaxscalepcre2.c)
|
||||
add_executable(testmaxscalepcre2 testmaxscalepcre2.c ../random_jkiss.c)
|
||||
target_link_libraries(test_mysql_users MySQLClient fullcore)
|
||||
target_link_libraries(test_hash fullcore log_manager)
|
||||
target_link_libraries(test_hint fullcore log_manager)
|
||||
|
@ -86,7 +86,7 @@ typedef struct router_object {
|
||||
DCB* backend_dcb,
|
||||
error_action_t action,
|
||||
bool* succp);
|
||||
uint8_t (*getCapabilities)(ROUTER *instance, void* router_session);
|
||||
int (*getCapabilities)();
|
||||
} ROUTER_OBJECT;
|
||||
|
||||
/**
|
||||
|
@ -290,7 +290,6 @@ struct router_client_session {
|
||||
rwsplit_config_t rses_config; /*< copied config info from router instance */
|
||||
int rses_nbackends;
|
||||
int rses_nsescmd; /*< Number of executed session commands */
|
||||
int rses_capabilities; /*< input type, for example */
|
||||
bool rses_autocommit_enabled;
|
||||
bool rses_transaction_active;
|
||||
bool rses_load_active; /*< If LOAD DATA LOCAL INFILE is
|
||||
|
@ -316,7 +316,6 @@ struct router_client_session {
|
||||
backend_ref_t* rses_backend_ref; /*< Pointer to backend reference array */
|
||||
schemarouter_config_t rses_config; /*< Copied config info from router instance */
|
||||
int rses_nbackends; /*< Number of backends */
|
||||
int rses_capabilities; /*< Input type, for example */
|
||||
bool rses_autocommit_enabled; /*< Is autocommit enabled */
|
||||
bool rses_transaction_active; /*< Is a transaction active */
|
||||
struct router_instance *router; /*< The router instance */
|
||||
|
@ -192,7 +192,6 @@ struct router_client_session {
|
||||
rses_property_t* rses_properties[RSES_PROP_TYPE_COUNT];
|
||||
|
||||
shard_config_t rses_config; /*< copied config info from router instance */
|
||||
int rses_capabilities; /*< input type, for example */
|
||||
bool rses_autocommit_enabled;
|
||||
bool rses_transaction_active;
|
||||
struct router_instance *router; /*< The router instance */
|
||||
|
@ -573,7 +573,7 @@ static int gw_read_backend_event(DCB *dcb) {
|
||||
if (dcb->session->state == SESSION_STATE_ROUTER_READY &&
|
||||
dcb->session->client != NULL &&
|
||||
dcb->session->client->state == DCB_STATE_POLLING &&
|
||||
(session->router_session || router->getCapabilities(router_instance, NULL) & RCAP_TYPE_NO_RSESSION))
|
||||
(session->router_session || router->getCapabilities() & RCAP_TYPE_NO_RSESSION))
|
||||
{
|
||||
client_protocol = SESSION_PROTOCOL(dcb->session,
|
||||
MySQLProtocol);
|
||||
|
@ -99,7 +99,7 @@ static void errorReply(
|
||||
error_action_t action,
|
||||
bool *succp);
|
||||
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
static int blr_handler_config(void *userdata, const char *section, const char *name, const char *value);
|
||||
static int blr_handle_config_item(const char *name, const char *value, ROUTER_INSTANCE *inst);
|
||||
static int blr_set_service_mysql_user(SERVICE *service);
|
||||
@ -113,7 +113,6 @@ extern int blr_read_events_all_events(ROUTER_INSTANCE *router, int fix, int debu
|
||||
void blr_master_close(ROUTER_INSTANCE *);
|
||||
char * blr_last_event_description(ROUTER_INSTANCE *router);
|
||||
extern int MaxScaleUptime();
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
char *blr_get_event_description(ROUTER_INSTANCE *router, uint8_t event);
|
||||
|
||||
/** The module object definition */
|
||||
@ -1517,7 +1516,7 @@ static void rses_end_locked_router_action(ROUTER_SLAVE * rses)
|
||||
}
|
||||
|
||||
|
||||
static uint8_t getCapabilities(ROUTER *inst, void *router_session)
|
||||
static int getCapabilities()
|
||||
{
|
||||
return RCAP_TYPE_NO_RSESSION;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ static void closeSession(ROUTER *instance, void *router_session);
|
||||
static void freeSession(ROUTER *instance, void *router_session);
|
||||
static int execute(ROUTER *instance, void *router_session, GWBUF *queue);
|
||||
static void diagnostics(ROUTER *instance, DCB *dcb);
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
|
||||
/** The module object definition */
|
||||
static ROUTER_OBJECT MyObject = {
|
||||
@ -287,9 +287,7 @@ diagnostics(ROUTER *instance, DCB *dcb)
|
||||
return; /* Nothing to do currently */
|
||||
}
|
||||
|
||||
static uint8_t getCapabilities(
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ static void closeSession(ROUTER *instance, void *router_session);
|
||||
static void freeSession(ROUTER *instance, void *router_session);
|
||||
static int execute(ROUTER *instance, void *router_session, GWBUF *queue);
|
||||
static void diagnostics(ROUTER *instance, DCB *dcb);
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
|
||||
/** The module object definition */
|
||||
static ROUTER_OBJECT MyObject = {
|
||||
@ -310,9 +310,7 @@ diagnostics(ROUTER *instance, DCB *dcb)
|
||||
return; /* Nothing to do currently */
|
||||
}
|
||||
|
||||
static uint8_t getCapabilities(
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ static void closeSession(ROUTER *instance, void *router_session);
|
||||
static void freeSession(ROUTER *instance, void *router_session);
|
||||
static int execute(ROUTER *instance, void *router_session, GWBUF *queue);
|
||||
static void diagnostics(ROUTER *instance, DCB *dcb);
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
static void handleError(
|
||||
ROUTER *instance,
|
||||
void *router_session,
|
||||
@ -415,10 +415,8 @@ diagnostics(ROUTER *instance, DCB *dcb)
|
||||
*
|
||||
* Not used for the maxinfo router
|
||||
*/
|
||||
static uint8_t
|
||||
getCapabilities(
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int
|
||||
getCapabilities()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ static void handleError(
|
||||
DCB *problem_dcb,
|
||||
error_action_t action,
|
||||
bool *succp);
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
|
||||
|
||||
/** The module object definition */
|
||||
@ -957,11 +957,9 @@ static void rses_end_locked_router_action(
|
||||
}
|
||||
|
||||
|
||||
static uint8_t getCapabilities(
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities()
|
||||
{
|
||||
return 0;
|
||||
return RCAP_TYPE_PACKET_INPUT;
|
||||
}
|
||||
|
||||
/********************************
|
||||
|
@ -130,7 +130,7 @@ static bool route_single_stmt(
|
||||
GWBUF* querybuf);
|
||||
|
||||
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities();
|
||||
|
||||
#if defined(NOT_USED)
|
||||
static bool router_option_configured(
|
||||
@ -912,7 +912,6 @@ static void* newSession(
|
||||
client_rses->rses_master_ref = master_ref;
|
||||
/* assert with master_host */
|
||||
ss_dassert(master_ref && (master_ref->bref_backend->backend_server && SERVER_MASTER));
|
||||
client_rses->rses_capabilities = RCAP_TYPE_STMT_INPUT;
|
||||
client_rses->rses_backend_ref = backend_ref;
|
||||
client_rses->rses_nbackends = router_nservers; /*< # of backend servers */
|
||||
|
||||
@ -4447,27 +4446,11 @@ static void tracelog_routed_query(
|
||||
|
||||
|
||||
/**
|
||||
* Return rc, rc < 0 if router session is closed. rc == 0 if there are no
|
||||
* capabilities specified, rc > 0 when there are capabilities.
|
||||
* Return RCAP_TYPE_STMT_INPUT.
|
||||
*/
|
||||
static uint8_t getCapabilities (
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities ()
|
||||
{
|
||||
ROUTER_CLIENT_SES* rses = (ROUTER_CLIENT_SES *)router_session;
|
||||
uint8_t rc;
|
||||
|
||||
if (!rses_begin_locked_router_action(rses))
|
||||
{
|
||||
rc = 0xff;
|
||||
goto return_rc;
|
||||
}
|
||||
rc = rses->rses_capabilities;
|
||||
|
||||
rses_end_locked_router_action(rses);
|
||||
|
||||
return_rc:
|
||||
return rc;
|
||||
return RCAP_TYPE_STMT_INPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ static route_target_t get_shard_route_target (
|
||||
bool trx_active,
|
||||
HINT* hint);
|
||||
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
|
||||
static bool connect_backend_servers(
|
||||
backend_ref_t* backend_ref,
|
||||
@ -1241,7 +1241,6 @@ static void* newSession(
|
||||
goto return_rses;
|
||||
}
|
||||
/** Copy backend pointers to router session. */
|
||||
client_rses->rses_capabilities = RCAP_TYPE_STMT_INPUT;
|
||||
client_rses->rses_backend_ref = backend_ref;
|
||||
client_rses->rses_nbackends = router_nservers; /*< # of backend servers */
|
||||
|
||||
@ -3934,27 +3933,11 @@ static void tracelog_routed_query(
|
||||
|
||||
|
||||
/**
|
||||
* Return rc, rc < 0 if router session is closed. rc == 0 if there are no
|
||||
* capabilities specified, rc > 0 when there are capabilities.
|
||||
* Return RCAP_TYPE_STMT_INPUT.
|
||||
*/
|
||||
static uint8_t getCapabilities (
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities ()
|
||||
{
|
||||
ROUTER_CLIENT_SES* rses = (ROUTER_CLIENT_SES *)router_session;
|
||||
uint8_t rc;
|
||||
|
||||
if (!rses_begin_locked_router_action(rses))
|
||||
{
|
||||
rc = 0xff;
|
||||
goto return_rc;
|
||||
}
|
||||
rc = rses->rses_capabilities;
|
||||
|
||||
rses_end_locked_router_action(rses);
|
||||
|
||||
return_rc:
|
||||
return rc;
|
||||
return RCAP_TYPE_STMT_INPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,7 +116,7 @@ static route_target_t get_shard_route_target(
|
||||
bool trx_active,
|
||||
HINT* hint);
|
||||
|
||||
static uint8_t getCapabilities(ROUTER* inst, void* router_session);
|
||||
static int getCapabilities();
|
||||
|
||||
void subsvc_clear_state(SUBSERVICE* svc,subsvc_state_t state);
|
||||
void subsvc_set_state(SUBSERVICE* svc,subsvc_state_t state);
|
||||
@ -1158,9 +1158,6 @@ newSession(
|
||||
free(dummy_upstream);
|
||||
}
|
||||
|
||||
|
||||
/** Copy backend pointers to router session. */
|
||||
client_rses->rses_capabilities = RCAP_TYPE_STMT_INPUT;
|
||||
router->stats.n_sessions += 1;
|
||||
|
||||
/**
|
||||
@ -2571,27 +2568,12 @@ mysql_sescmd_get_property(
|
||||
}
|
||||
|
||||
/**
|
||||
* Return rc, rc < 0 if router session is closed. rc == 0 if there are no
|
||||
* capabilities specified, rc > 0 when there are capabilities.
|
||||
* Return RCAP_TYPE_STMT_INPUT
|
||||
*/
|
||||
static uint8_t
|
||||
getCapabilities(ROUTER* inst,
|
||||
void* router_session)
|
||||
static int
|
||||
getCapabilities()
|
||||
{
|
||||
ROUTER_CLIENT_SES* rses = (ROUTER_CLIENT_SES *) router_session;
|
||||
uint8_t rc;
|
||||
|
||||
if(!rses_begin_locked_router_action(rses))
|
||||
{
|
||||
rc = 0xff;
|
||||
goto return_rc;
|
||||
}
|
||||
rc = rses->rses_capabilities;
|
||||
|
||||
rses_end_locked_router_action(rses);
|
||||
|
||||
return_rc:
|
||||
return rc;
|
||||
return RCAP_TYPE_STMT_INPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ static void freeSession(ROUTER *instance, void *session);
|
||||
static int routeQuery(ROUTER *instance, void *session, GWBUF *queue);
|
||||
static void clientReply(ROUTER *instance, void *session, GWBUF *queue,DCB*);
|
||||
static void diagnostic(ROUTER *instance, DCB *dcb);
|
||||
static uint8_t getCapabilities (ROUTER* inst, void* router_session);
|
||||
static int getCapabilities ();
|
||||
static void handleError(
|
||||
ROUTER *instance,
|
||||
void *router_session,
|
||||
@ -166,9 +166,7 @@ diagnostic(ROUTER *instance, DCB *dcb)
|
||||
{
|
||||
}
|
||||
|
||||
static uint8_t getCapabilities(
|
||||
ROUTER* inst,
|
||||
void* router_session)
|
||||
static int getCapabilities()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user