diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-06-25 12:01:47 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-06-25 12:01:47 +0400 |
commit | 700f8add127dbb6f566e95ea1dd682c054d75c9c (patch) | |
tree | 5e2013e29e8356db0cb122d37e6c5e253fd7b1d7 | |
parent | 479d24a2130e629306ce8c2e02bad3b0aa7b57e6 (diff) | |
download | mariadb-git-700f8add127dbb6f566e95ea1dd682c054d75c9c.tar.gz |
Bug#54422 query with = 'variables'
During creation of the table list of
processed tables hidden I_S table 'VARIABLES'
is erroneously added into the table list.
it leads to ER_UNKNOWN_TABLE error in
TABLE_LIST::add_table_to_list() function.
The fix is to skip addition of hidden I_S
tables into the table list.
-rw-r--r-- | mysql-test/r/information_schema.result | 10 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 9 | ||||
-rw-r--r-- | sql/sql_show.cc | 4 |
3 files changed, 22 insertions, 1 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 4ed7e4e700b..b7b65598c6d 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1747,4 +1747,14 @@ COUNT(*) DROP USER nonpriv; DROP TABLE db1.t1; DROP DATABASE db1; + +Bug#54422 query with = 'variables' + +CREATE TABLE variables(f1 INT); +SELECT COLUMN_DEFAULT, TABLE_NAME +FROM INFORMATION_SCHEMA.COLUMNS +WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables'; +COLUMN_DEFAULT TABLE_NAME +NULL variables +DROP TABLE variables; End of 5.1 tests. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index f3ce3d87252..fa4b880aead 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1445,6 +1445,15 @@ DROP USER nonpriv; DROP TABLE db1.t1; DROP DATABASE db1; +--echo +--echo Bug#54422 query with = 'variables' +--echo + +CREATE TABLE variables(f1 INT); +SELECT COLUMN_DEFAULT, TABLE_NAME +FROM INFORMATION_SCHEMA.COLUMNS +WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables'; +DROP TABLE variables; --echo End of 5.1 tests. diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f634c149fd9..33abf356718 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2921,7 +2921,9 @@ make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex, { if (with_i_schema) { - if (find_schema_table(thd, lookup_field_vals->table_value.str)) + ST_SCHEMA_TABLE *schema_table= + find_schema_table(thd, lookup_field_vals->table_value.str); + if (schema_table && !schema_table->hidden) { if (table_names->push_back(&lookup_field_vals->table_value)) return 1; |