Fix to bug #507, http://bugs.mariadb.com/show_bug.cgi?id=507
readwritesplit.c:get_route_target routed query to slave although query type was combined QUERY_TYPE_READ | QUERY_TYPE_MASTER_READ, where the latter is supposed to be routed to master.
This commit is contained in:
parent
270c0ebf8a
commit
21bb341c7d
@ -980,6 +980,7 @@ SERVICE *ptr;
|
||||
}
|
||||
while (ptr)
|
||||
{
|
||||
ss_dassert(ptr->stats.n_current >= 0);
|
||||
dcb_printf(dcb, "%-25s | %-20s | %6d | %5d\n",
|
||||
ptr->name, ptr->routerModule,
|
||||
ptr->stats.n_current, ptr->stats.n_sessions);
|
||||
|
@ -1402,7 +1402,8 @@ static route_target_t get_route_target (
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_GSYSVAR_READ))) /*< read global sys var */
|
||||
{
|
||||
/** First set expected targets before evaluating hints */
|
||||
if (QUERY_IS_TYPE(qtype, QUERY_TYPE_READ) ||
|
||||
if (!QUERY_IS_TYPE(qtype, QUERY_TYPE_MASTER_READ) &&
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_READ) ||
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_SHOW_TABLES) || /*< 'SHOW TABLES' */
|
||||
/** Configured to allow reading variables from slaves */
|
||||
(use_sql_variables_in == TYPE_ALL &&
|
||||
@ -1412,7 +1413,8 @@ static route_target_t get_route_target (
|
||||
{
|
||||
target = TARGET_SLAVE;
|
||||
}
|
||||
else if (QUERY_IS_TYPE(qtype, QUERY_TYPE_EXEC_STMT) ||
|
||||
else if (QUERY_IS_TYPE(qtype, QUERY_TYPE_MASTER_READ) ||
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_EXEC_STMT) ||
|
||||
/** Configured not to allow reading variables from slaves */
|
||||
(use_sql_variables_in == TYPE_MASTER &&
|
||||
(QUERY_IS_TYPE(qtype, QUERY_TYPE_USERVAR_READ) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user