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