Fix bugs introduced by refactoring

Fixed minor bugs that were introduced by the refactoring.
This commit is contained in:
Markus Mäkelä
2017-03-28 09:32:54 +03:00
parent 94ac2d89d0
commit f9e5275605

View File

@ -527,7 +527,7 @@ int32_t SchemaRouterSession::routeQuery(GWBUF* pPacket)
ret = 1; ret = 1;
} }
} }
else else if (target == NULL)
{ {
target = resolve_query_target(pPacket, type, command, route_target); target = resolve_query_target(pPacket, type, command, route_target);
} }
@ -601,7 +601,7 @@ void SchemaRouterSession::handle_mapping_reply(Backend* bref, GWBUF** pPacket)
if (m_queue.size() && rc != -1) if (m_queue.size() && rc != -1)
{ {
ss_dassert(m_state == INIT_READY); ss_dassert(m_state == INIT_READY || m_state == INIT_USE_DB);
route_queued_query(); route_queued_query();
} }
} }
@ -1726,6 +1726,7 @@ SERVER* SchemaRouterSession::get_shard_target(GWBUF* buffer, uint32_t qtype)
MXS_INFO("Routing hint found (%s)", rval->unique_name); MXS_INFO("Routing hint found (%s)", rval->unique_name);
} }
} }
}
if (rval == NULL && !has_dbs && m_current_db.length()) if (rval == NULL && !has_dbs && m_current_db.length())
{ {
@ -1742,7 +1743,6 @@ SERVER* SchemaRouterSession::get_shard_target(GWBUF* buffer, uint32_t qtype)
m_current_db.c_str(), rval->unique_name); m_current_db.c_str(), rval->unique_name);
} }
} }
}
return rval; return rval;
} }