1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Bug#30079 A check for "hidden" I_S tables is flawed

added check for hidden I_S tables for 'show columns|keys' commands
This commit is contained in:
gluh@mysql.com/eagle.(none)
2007-10-04 16:20:56 +05:00
parent 0918fe8320
commit d6e626a61d
3 changed files with 19 additions and 1 deletions

View File

@@ -1386,3 +1386,7 @@ f7 datetime NO NULL
f8 datetime YES 2006-01-01 00:00:00 f8 datetime YES 2006-01-01 00:00:00
drop table t1; drop table t1;
End of 5.0 tests. End of 5.0 tests.
show fields from information_schema.TABLE_NAMES;
ERROR 42S02: Unknown table 'TABLE_NAMES' in information_schema
show keys from information_schema.TABLE_NAMES;
ERROR 42S02: Unknown table 'TABLE_NAMES' in information_schema

View File

@@ -1089,3 +1089,12 @@ show columns from t1;
drop table t1; drop table t1;
--echo End of 5.0 tests. --echo End of 5.0 tests.
#
# Bug#30079 A check for "hidden" I_S tables is flawed
#
--error 1109
show fields from information_schema.TABLE_NAMES;
--error 1109
show keys from information_schema.TABLE_NAMES;

View File

@@ -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); ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table || if (!schema_table ||
(schema_table->hidden && (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), my_error(ER_UNKNOWN_TABLE, MYF(0),
ptr->table_name, INFORMATION_SCHEMA_NAME.str); ptr->table_name, INFORMATION_SCHEMA_NAME.str);