List:Commits« Previous MessageNext Message »
From:gluh Date:August 14 2007 9:58am
Subject:bk commit into 5.0 tree (gluh:1.2513) BUG#30079
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-08-14 14:58:25+05:00, gluh@stripped +3 -0
  Bug#30079 A check for "hidden" I_S tables is flawed
  added check for hidden I_S tables for 'show columns|keys' commands

  mysql-test/r/information_schema.result@stripped, 2007-08-14 14:58:24+05:00, gluh@stripped +4 -0
    test result

  mysql-test/t/information_schema.test@stripped, 2007-08-14 14:58:24+05:00, gluh@stripped +9 -0
    test case

  sql/sql_parse.cc@stripped, 2007-08-14 14:58:24+05:00, gluh@stripped +6 -1
    added check for hidden I_S tables for 'show columns|keys' commands

diff -Nrup a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
--- a/mysql-test/r/information_schema.result	2007-07-12 02:10:26 +05:00
+++ b/mysql-test/r/information_schema.result	2007-08-14 14:58:24 +05:00
@@ -1331,3 +1331,7 @@ ERROR 42000: You have an error in your S
 alter database test;
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 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
diff -Nrup a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
--- a/mysql-test/t/information_schema.test	2007-07-12 02:10:26 +05:00
+++ b/mysql-test/t/information_schema.test	2007-08-14 14:58:24 +05:00
@@ -1046,3 +1046,12 @@ alter database;
 --error ER_PARSE_ERROR
 alter database test;
 --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;
+
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2007-08-02 14:51:00 +05:00
+++ b/sql/sql_parse.cc	2007-08-14 14:58:24 +05:00
@@ -6420,7 +6420,12 @@ TABLE_LIST *st_select_lex::add_table_to_
     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);
Thread
bk commit into 5.0 tree (gluh:1.2513) BUG#30079gluh14 Aug