summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 084bcfc3c76..52f8fe8615f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6427,7 +6427,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table ||
(schema_table->hidden &&
- lex->orig_sql_command == SQLCOM_END)) // not a 'show' command
+ (lex->orig_sql_command == SQLCOM_END || // not a 'show' command
+ /*
+ this check is used for show columns|keys from I_S hidden table
+ */
+ lex->orig_sql_command == SQLCOM_SHOW_FIELDS ||
+ lex->orig_sql_command == SQLCOM_SHOW_KEYS)))
{
my_error(ER_UNKNOWN_TABLE, MYF(0),
ptr->table_name, INFORMATION_SCHEMA_NAME.str);