MXS-2337 Schemarouter responds correctly to SHOW TABLES
The router now handles the query similarly to a "SHOW TABLES FROM X" with the current db assigned to X.
This commit is contained in:
@ -1592,8 +1592,17 @@ bool SchemaRouterSession::send_tables(GWBUF* pPacket)
|
|||||||
|
|
||||||
if (database.empty())
|
if (database.empty())
|
||||||
{
|
{
|
||||||
MXS_FREE(query);
|
// Was not a "show tables from x". If a current database is selected, use that as target.
|
||||||
return false;
|
if (!m_current_db.empty())
|
||||||
|
{
|
||||||
|
database = m_current_db;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No current db, route the query to a server, likely getting "No database selected"
|
||||||
|
MXS_FREE(query);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerMap tablelist;
|
ServerMap tablelist;
|
||||||
|
Reference in New Issue
Block a user