List:Internals« Previous MessageNext Message »
From:gluh Date:April 20 2005 11:01am
Subject:bk commit into 5.0 tree (gluh:1.1859) BUG#9838
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
  1.1859 05/04/20 16:00:57 gluh@stripped +4 -0
  Fix for bug#9838 INFORMATION_SCHEMA.COLUMNS columns of granted views missing

  sql/sql_show.cc
    1.238 05/04/20 16:00:00 gluh@stripped +2 -2
    Fix for bug#9838 INFORMATION_SCHEMA.COLUMNS columns of granted views missing
        use 'base_name', 'file_name' because 'tables->db', 'tables->tables' could be invalid in
        case of view(derived tables).

  sql/sql_acl.cc
    1.148 05/04/20 16:00:00 gluh@stripped +2 -2
    Fix for bug#9838 INFORMATION_SCHEMA.COLUMNS columns of granted views missing
        use grant_table->privs(table grants) instead of grant->prvileges(global privileges)

  mysql-test/t/information_schema.test
    1.34 05/04/20 16:00:00 gluh@stripped +5 -1
    Fix for bug#9838 INFORMATION_SCHEMA.COLUMNS columns of granted views missing

  mysql-test/r/information_schema.result
    1.47 05/04/20 16:00:00 gluh@stripped +7 -1
    Fix for bug#9838 INFORMATION_SCHEMA.COLUMNS columns of granted views missing

# 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:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/mysql-5.0.9838

--- 1.147/sql/sql_acl.cc	Tue Mar 29 14:58:30 2005
+++ 1.148/sql/sql_acl.cc	Wed Apr 20 16:00:00 2005
@@ -3684,9 +3684,9 @@
     grant_column= column_hash_search(grant_table, field_name,
                                      (uint) strlen(field_name));
     if (!grant_column)
-      priv= grant->privilege;
+      priv= grant_table->privs;
     else
-      priv= grant->privilege | grant_column->rights;
+      priv= grant_table->privs | grant_column->rights;
   }
   rw_unlock(&LOCK_grant);
   return priv;

--- 1.237/sql/sql_show.cc	Sun Apr 17 21:54:27 2005
+++ 1.238/sql/sql_show.cc	Wed Apr 20 16:00:00 2005
@@ -2300,8 +2300,8 @@
       uint col_access;
       check_access(thd,SELECT_ACL | EXTRA_ACL, base_name,
                    &tables->grant.privilege, 0, 0);
-      col_access= get_column_grant(thd, &tables->grant, tables->db,
-                                   tables->table_name,
+      col_access= get_column_grant(thd, &tables->grant, 
+                                   base_name, file_name,
                                    field->field_name) & COL_ACLS;
       if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS  && !col_access)
         continue;

--- 1.46/mysql-test/r/information_schema.result	Thu Apr 14 11:04:11 2005
+++ 1.47/mysql-test/r/information_schema.result	Wed Apr 20 16:00:00 2005
@@ -154,16 +154,22 @@
 show columns from mysqltest.t1 where field like "%a%";
 Field	Type	Null	Key	Default	Extra
 a	int(11)	YES		NULL	
+create view mysqltest.v1 (c) as select a from mysqltest.t1;
 grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
+grant select on mysqltest.v1 to mysqltest_2@localhost;
 select table_name, column_name, privileges from information_schema.columns 
 where table_schema = 'mysqltest' and table_name = 't1';
 table_name	column_name	privileges
 t1	a	select
+select table_name, column_name, privileges from information_schema.columns
+where table_schema = 'mysqltest' and table_name = 'v1';
+table_name	column_name	privileges
+v1	c	select
 show columns from mysqltest.t1;
 Field	Type	Null	Key	Default	Extra
 a	int(11)	YES		NULL	
 b	varchar(30)	YES	MUL	NULL	
-drop view v1;
+drop view v1, mysqltest.v1;
 drop tables mysqltest.t4, mysqltest.t1, t2, t3;
 drop database mysqltest;
 select * from information_schema.CHARACTER_SETS

--- 1.33/mysql-test/t/information_schema.test	Thu Apr 14 11:03:09 2005
+++ 1.34/mysql-test/t/information_schema.test	Wed Apr 20 16:00:00 2005
@@ -53,15 +53,19 @@
 and column_name= "a";
 show columns from mysqltest.t1 where field like "%a%";
 
+create view mysqltest.v1 (c) as select a from mysqltest.t1;
 grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
+grant select on mysqltest.v1 to mysqltest_2@localhost;
 connect (user3,localhost,mysqltest_2,,);
 connection user3;
 select table_name, column_name, privileges from information_schema.columns 
 where table_schema = 'mysqltest' and table_name = 't1';
+select table_name, column_name, privileges from information_schema.columns
+where table_schema = 'mysqltest' and table_name = 'v1';
 show columns from mysqltest.t1;
 connection default;
 
-drop view v1;
+drop view v1, mysqltest.v1;
 drop tables mysqltest.t4, mysqltest.t1, t2, t3;
 drop database mysqltest;
 
Thread
bk commit into 5.0 tree (gluh:1.1859) BUG#9838gluh20 Apr