List:Commits« Previous MessageNext Message »
From:kgeorge Date:June 20 2006 3:13pm
Subject:bk commit into 5.0 tree (gkodinov:1.2186) BUG#20543
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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
  1.2186 06/06/20 18:13:13 gkodinov@stripped +3 -0
  Bug#20543: select on information_schema strange warnings, view, different
              schemas/users
  When the columns of the view cannot be determined when selecting from 
  INFORMATION_SCHEMA.COLUMNS there was a warning sent to the client that
  executes the SELECT from INFORMATION_SCHEMA.COLUMNS.
  
  Error accessing table in SELECT ... FROM INFORMATION_SCHEMA.COLUMNS should 
  result in warning in COLUMN_COMMENTS instead of warning sent to the user.

  sql/sql_show.cc
    1.320 06/06/20 18:13:08 gkodinov@stripped +2 -2
    Bug#20543: select on information_schema strange warnings, view, different
                schemas/users
     - Error accessing table in SELECT ... FROM INFORMATION_SCHEMA.COLUMNS
       should result in warning in COLUMN_COMMENTS instead of warning sent to
       the user

  mysql-test/t/information_schema.test
    1.83 06/06/20 18:13:08 gkodinov@stripped +28 -0
    Bug#20543: select on information_schema strange warnings, view, different
                schemas/users
     - test suite for the bug

  mysql-test/r/information_schema.result
    1.108 06/06/20 18:13:08 gkodinov@stripped +17 -3
    Bug#20543: select on information_schema strange warnings, view, different
                schemas/users
     - test suite for the bug

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gkodinov
# Host:	rakia.(none)
# Root:	/home/kgeorge/mysql/5.0/B20543

--- 1.319/sql/sql_show.cc	2006-06-06 09:25:25 +03:00
+++ 1.320/sql/sql_show.cc	2006-06-20 18:13:08 +03:00
@@ -2553,12 +2553,12 @@
   {
     if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS)
     {
+      const char *error= thd->net.last_error;
       /*
         I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS
         rather than in SHOW COLUMNS
       */ 
-      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                   thd->net.last_errno, thd->net.last_error);
+      table->field[18]->store(error, strlen(error), cs);
       thd->clear_error();
       res= 0;
     }

--- 1.107/mysql-test/r/information_schema.result	2006-06-06 10:57:44 +03:00
+++ 1.108/mysql-test/r/information_schema.result	2006-06-20 18:13:08 +03:00
@@ -671,9 +671,6 @@
 where table_schema='test';
 column_name
 f1
-Warnings:
-Warning	1356	View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-Warning	1356	View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
 select index_name from information_schema.statistics where table_schema='test';
 index_name
 f1_key
@@ -1134,3 +1131,20 @@
 .t1	.	t1
 .t2	.	t2
 drop table t1,t2;
+CREATE DATABASE testdb_1;
+CREATE USER testdb_1@localhost identified by 'PWD';
+GRANT ALL ON testdb_1.* to testdb_1@localhost WITH GRANT OPTION;
+CREATE USER testdb_2@localhost identified by 'PWD';
+GRANT ALL ON test.* to testdb_2@localhost WITH GRANT OPTION;
+USE testdb_1;
+CREATE TABLE t1 (f1 CHAR(4), f2 CHAR(4), f3 CHAR(3));
+CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
+GRANT INSERT ON v1 TO testdb_2@localhost WITH GRANT OPTION;
+CREATE VIEW v2 AS SELECT f1, f2, f3 FROM testdb_1.v1;
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS A where A.TABLE_NAME = 'v2';
+TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME	ORDINAL_POSITION	COLUMN_DEFAULT	IS_NULLABLE	DATA_TYPE	CHARACTER_MAXIMUM_LENGTH	CHARACTER_OCTET_LENGTH	NUMERIC_PRECISION	NUMERIC_SCALE	CHARACTER_SET_NAME	COLLATION_NAME	COLUMN_TYPE	COLUMN_KEY	EXTRA	PRIVILEGES	COLUMN_COMMENT
+DROP VIEW testdb_1.v1,v2;
+DROP TABLE testdb_1.t1;
+DROP DATABASE testdb_1;
+DROP USER testdb_1@localhost;
+DROP USER testdb_2@localhost;

--- 1.82/mysql-test/t/information_schema.test	2006-06-06 10:57:44 +03:00
+++ 1.83/mysql-test/t/information_schema.test	2006-06-20 18:13:08 +03:00
@@ -852,3 +852,31 @@
 select concat(@a, table_name), @a, table_name
 from information_schema.tables where table_schema = 'test';
 drop table t1,t2;
+
+#
+# Bug#20543: select on information_schema strange warnings, view, different
+#             schemas/users
+#
+#
+CREATE DATABASE testdb_1;
+CREATE USER testdb_1@localhost identified by 'PWD';
+GRANT ALL ON testdb_1.* to testdb_1@localhost WITH GRANT OPTION;
+CREATE USER testdb_2@localhost identified by 'PWD';
+GRANT ALL ON test.* to testdb_2@localhost WITH GRANT OPTION;
+
+connect (testdb_1,localhost,testdb_1,PWD,test);
+USE testdb_1;
+CREATE TABLE t1 (f1 CHAR(4), f2 CHAR(4), f3 CHAR(3));
+CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
+GRANT INSERT ON v1 TO testdb_2@localhost WITH GRANT OPTION;
+
+connect (testdb_2,localhost,testdb_2,PWD,test);
+CREATE VIEW v2 AS SELECT f1, f2, f3 FROM testdb_1.v1;
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS A where A.TABLE_NAME = 'v2';
+connection default;
+
+DROP VIEW testdb_1.v1,v2;
+DROP TABLE testdb_1.t1;
+DROP DATABASE testdb_1;
+DROP USER testdb_1@localhost;
+DROP USER testdb_2@localhost;
Thread
bk commit into 5.0 tree (gkodinov:1.2186) BUG#20543kgeorge20 Jun