MXS-2407 Report database for SHOW TABLES FROM db
The database used in 'SHOW TABLES FROM db' is now available via qc_get_database_names().
This commit is contained in:
@ -1848,14 +1848,14 @@ int32_t qc_mysql_get_database_names(GWBUF* querybuf, char*** databasesp, int* si
|
||||
goto retblock;
|
||||
}
|
||||
|
||||
if (lex->describe || is_show_command(lex->sql_command))
|
||||
if (lex->describe || (is_show_command(lex->sql_command) && !(lex->sql_command == SQLCOM_SHOW_TABLES)))
|
||||
{
|
||||
goto retblock;
|
||||
}
|
||||
|
||||
if (lex->sql_command == SQLCOM_CHANGE_DB)
|
||||
if (lex->sql_command == SQLCOM_CHANGE_DB || lex->sql_command == SQLCOM_SHOW_TABLES)
|
||||
{
|
||||
if (lex->select_lex.db)
|
||||
if (lex->select_lex.db && (strcmp(lex->select_lex.db, "skygw_virtual") != 0))
|
||||
{
|
||||
if (i >= currsz)
|
||||
{
|
||||
|
@ -3031,6 +3031,14 @@ public:
|
||||
|
||||
case MXS_SHOW_TABLES:
|
||||
m_type_mask = QUERY_TYPE_SHOW_TABLES;
|
||||
if (pShow->pDatabase->z)
|
||||
{
|
||||
char db[pShow->pDatabase->n + 1];
|
||||
strncpy(db, pShow->pDatabase->z, pShow->pDatabase->n);
|
||||
db[pShow->pDatabase->n] = 0;
|
||||
|
||||
update_database_names(db);
|
||||
}
|
||||
break;
|
||||
|
||||
case MXS_SHOW_VARIABLES:
|
||||
|
Reference in New Issue
Block a user