Fix relaxed multi-statement mode
The relaxed mode for multi-statements wasn't working as it required the configuration to be enabled.
This commit is contained in:
@ -138,6 +138,13 @@ bool route_single_stmt(ROUTER_INSTANCE *inst, ROUTER_CLIENT_SES *rses,
|
|||||||
else if (TARGET_IS_MASTER(route_target))
|
else if (TARGET_IS_MASTER(route_target))
|
||||||
{
|
{
|
||||||
succp = handle_master_is_target(inst, rses, &target_dcb);
|
succp = handle_master_is_target(inst, rses, &target_dcb);
|
||||||
|
|
||||||
|
if (!rses->rses_config.strict_multi_stmt &&
|
||||||
|
rses->forced_node == rses->rses_master_ref)
|
||||||
|
{
|
||||||
|
/** Reset the forced node as we're in relaxed multi-statement mode */
|
||||||
|
rses->forced_node = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target_dcb && succp) /*< Have DCB of the target backend */
|
if (target_dcb && succp) /*< Have DCB of the target backend */
|
||||||
@ -707,8 +714,7 @@ route_target_t get_route_target(ROUTER_CLIENT_SES *rses,
|
|||||||
target_t use_sql_variables_in = rses->rses_config.use_sql_variables_in;
|
target_t use_sql_variables_in = rses->rses_config.use_sql_variables_in;
|
||||||
route_target_t target = TARGET_UNDEFINED;
|
route_target_t target = TARGET_UNDEFINED;
|
||||||
|
|
||||||
if (rses->rses_config.strict_multi_stmt && rses->forced_node &&
|
if (rses->forced_node && rses->forced_node == rses->rses_master_ref)
|
||||||
rses->forced_node == rses->rses_master_ref)
|
|
||||||
{
|
{
|
||||||
target = TARGET_MASTER;
|
target = TARGET_MASTER;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user