List:Commits« Previous MessageNext Message »
From:kpettersson Date:March 4 2008 6:35pm
Subject:bk commit into 6.0 tree (thek:1.2588)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of thek.  When thek 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, 2008-03-04 18:35:42+01:00, thek@adventure.(none) +5 -0
  Fixed merge errors + test case depending on faulty privilege requirements for
  SHOW CREATE VIEW.

  mysql-test/r/grant4.result@stripped, 2008-03-04 18:35:39+01:00, thek@adventure.(none) +4 -4
    Adjusted test result according to new features introfuced.

  mysql-test/r/view_grant.result@stripped, 2008-03-04 18:35:39+01:00, thek@adventure.(none) +4
-13
    SHOW CREATE VIEW now demands SELECT_ACL and SHOW_CREATE_VIEW_ACL. Fortunatly
    this test case isn't depending on SHOW CREATE VIEW; -fixed test errors.

  mysql-test/t/view_grant.test@stripped, 2008-03-04 18:35:39+01:00, thek@adventure.(none) +0
-3
    SHOW CREATE VIEW now demands SELECT_ACL and SHOW_CREATE_VIEW_ACL. Fortunatly
    this test case isn't depending on SHOW CREATE VIEW; -fixed test errors.

  sql/mysql_priv.h@stripped, 2008-03-04 18:35:39+01:00, thek@adventure.(none) +1 -1
    Fixed merge error.

  sql/sql_parse.cc@stripped, 2008-03-04 18:35:39+01:00, thek@adventure.(none) +5 -4
    Fixed merge error: New signature on check_table_access.

diff -Nrup a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
--- a/mysql-test/r/grant4.result	2008-03-04 17:26:57 +01:00
+++ b/mysql-test/r/grant4.result	2008-03-04 18:35:39 +01:00
@@ -87,15 +87,15 @@ use mysqltest_db1;
 ** Connect as restricted user mysqltest_u1.
 ** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do
(authentication is enough).
 SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5';
-TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	NON_UNIQUE	INDEX_SCHEMA	INDEX_NAME	SEQ_IN_INDEX	COLUMN_NAME	COLLATION	CARDINALITY	SUB_PART	PACKED	NULLABLE	INDEX_TYPE	COMMENT
-NULL	mysqltest_db1	t5	1	mysqltest_db1	i	1	s1	A	NULL	NULL	NULL	YES	BTREE	
+TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	NON_UNIQUE	INDEX_SCHEMA	INDEX_NAME	SEQ_IN_INDEX	COLUMN_NAME	COLLATION	CARDINALITY	SUB_PART	PACKED	NULLABLE	INDEX_TYPE	COMMENT	INDEX_COMMENT
+NULL	mysqltest_db1	t5	1	mysqltest_db1	i	1	s1	A	NULL	NULL	NULL	YES	BTREE		
 ** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column
combination.
 SHOW INDEX FROM t5;
 ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
 ** SHOW INDEX FROM t6 will succeed because there exist a privilege on a column
combination on t6.
 SHOW INDEX FROM t6;
-Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
-t6	1	i	1	s1	A	NULL	NULL	NULL	YES	BTREE	
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
+t6	1	i	1	s1	A	NULL	NULL	NULL	YES	BTREE		
 ** CHECK TABLE requires any privilege on any column combination and should succeed for
t6:
 CHECK TABLE t6;
 Table	Op	Msg_type	Msg_text
diff -Nrup a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
--- a/mysql-test/r/view_grant.result	2008-03-04 17:28:00 +01:00
+++ b/mysql-test/r/view_grant.result	2008-03-04 18:35:39 +01:00
@@ -799,28 +799,19 @@ CREATE USER u29908_1@localhost;
 CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
 CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
 SELECT f1 FROM t1;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
 GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
 CREATE USER u29908_2@localhost;
-GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
+GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
 GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
 ALTER VIEW v1 AS SELECT f2 FROM t1;
 ERROR 42000: Access denied; you need the SUPER privilege for this operation
 ALTER VIEW v2 AS SELECT f2 FROM t1;
 ERROR 42000: Access denied; you need the SUPER privilege for this operation
-SHOW CREATE VIEW v2;
-View	Create View	character_set_client	collation_connection
-v2	CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW
`v2` AS select `t1`.`f1` AS `f1` from `t1`	latin1	latin1_swedish_ci
 ALTER VIEW v1 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v1;
-View	Create View	character_set_client	collation_connection
-v1	CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY DEFINER VIEW
`v1` AS select `t1`.`f2` AS `f2` from `t1`	latin1	latin1_swedish_ci
 ALTER VIEW v2 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v2;
-View	Create View	character_set_client	collation_connection
-v2	CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW
`v2` AS select `t1`.`f2` AS `f2` from `t1`	latin1	latin1_swedish_ci
 ALTER VIEW v1 AS SELECT f1 FROM t1;
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
diff -Nrup a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
--- a/mysql-test/t/view_grant.test	2008-02-21 10:22:18 +01:00
+++ b/mysql-test/t/view_grant.test	2008-03-04 18:35:39 +01:00
@@ -1079,13 +1079,10 @@ connect (u2,localhost,u29908_2,,mysqltes
 ALTER VIEW v1 AS SELECT f2 FROM t1;
 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
 ALTER VIEW v2 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v2;
 
 connect (u1,localhost,u29908_1,,mysqltest_29908);
 ALTER VIEW v1 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v1;
 ALTER VIEW v2 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v2;
 
 connection root;
 ALTER VIEW v1 AS SELECT f1 FROM t1;
diff -Nrup a/sql/mysql_priv.h b/sql/mysql_priv.h
--- a/sql/mysql_priv.h	2008-03-04 17:41:28 +01:00
+++ b/sql/mysql_priv.h	2008-03-04 18:35:39 +01:00
@@ -1115,7 +1115,7 @@ bool check_access(THD *thd, ulong access
 		  bool no_grant, bool no_errors, bool schema_db);
 bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
                         bool no_errors,
-                        bool any_combination_of_privileges_will_do.
+                        bool any_combination_of_privileges_will_do,
 			uint number);
 #else
 inline bool check_access(THD *thd, ulong access, const char *db,
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2008-03-04 17:41:28 +01:00
+++ b/sql/sql_parse.cc	2008-03-04 18:35:39 +01:00
@@ -2656,7 +2656,7 @@ end_with_restore_list:
       */
       if (lex->only_view)
       {
-        if (check_table_access(thd, SELECT_ACL, first_table, FALSE, FALSE))
+        if (check_table_access(thd, SELECT_ACL, first_table, FALSE, FALSE,1))
         {
           my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
                   "SHOW", thd->security_ctx->priv_user,
@@ -3239,7 +3239,7 @@ end_with_restore_list:
     break;
   case SQLCOM_LOCK_TABLES:
     if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables,
-                           UINT_MAX, FALSE))
+                           FALSE, FALSE, UINT_MAX))
       goto error;
     /*
       We try to take transactional locks if
@@ -7263,12 +7263,13 @@ bool create_table_precheck(THD *thd, TAB
       }
     }
 #endif
-    if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE, FALSE,
UINT_MAX))
+    if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE, FALSE,
+                                     UINT_MAX))
       goto err;
   }
   else if (lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
   {
-    if (check_table_access(thd, SELECT_ACL, tables, 0, FALSE))
+    if (check_table_access(thd, SELECT_ACL, tables, FALSE, FALSE, UINT_MAX))
       goto err;
   }
   error= FALSE;
Thread
bk commit into 6.0 tree (thek:1.2588)kpettersson4 Mar