List:Commits« Previous MessageNext Message »
From:kpettersson Date:March 25 2008 12:52pm
Subject:bk commit into 5.0 tree (thek:1.2595) BUG#33275
View as plain text  
Below is the list of changes that have just been committed into a local
5.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-25 12:52:55+01:00, thek@adventure.(none) +3 -0
  Bug#33275 Server crash when creating temporary table mysql.user
  
  When creating a temporary table that uses the same name as the mysql
  privs table the server would crash on FLUSH PRIVILEGES.
  
  This patches corrects the problem by setting a flag to ignore any
  temporary table when trying to reload the privileges.

  mysql-test/r/grant.result@stripped, 2008-03-25 12:52:51+01:00, thek@adventure.(none) +6 -0
    Test for checking shadowing of privilege tables

  mysql-test/t/grant.test@stripped, 2008-03-25 12:52:52+01:00, thek@adventure.(none) +7 -0
    Test for checking shadowing of privilege tables

  sql/sql_acl.cc@stripped, 2008-03-25 12:52:52+01:00, thek@adventure.(none) +4 -1
    Set flag for ignoring temporary tables when trying to reload privileges.

diff -Nrup a/mysql-test/r/grant.result b/mysql-test/r/grant.result
--- a/mysql-test/r/grant.result	2007-12-07 11:39:36 +01:00
+++ b/mysql-test/r/grant.result	2008-03-25 12:52:51 +01:00
@@ -1129,4 +1129,10 @@ DROP USER mysqltest_1@localhost;
 DROP DATABASE db27878;
 use test;
 DROP TABLE t1;
+#
+#  Bug#33275 Server crash when creating temporary table mysql.user
+#
+CREATE TEMPORARY TABLE mysql.user (id INT);
+FLUSH PRIVILEGES;
+DROP TABLE mysql.user;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/grant.test b/mysql-test/t/grant.test
--- a/mysql-test/t/grant.test	2007-12-07 11:39:36 +01:00
+++ b/mysql-test/t/grant.test	2008-03-25 12:52:52 +01:00
@@ -1153,4 +1153,11 @@ DROP DATABASE db27878;
 use test;
 DROP TABLE t1;
 
+--echo #
+--echo #  Bug#33275 Server crash when creating temporary table mysql.user
+--echo #
+CREATE TEMPORARY TABLE mysql.user (id INT);
+FLUSH PRIVILEGES;
+DROP TABLE mysql.user;
+
 --echo End of 5.0 tests
diff -Nrup a/sql/sql_acl.cc b/sql/sql_acl.cc
--- a/sql/sql_acl.cc	2008-01-31 16:15:36 +01:00
+++ b/sql/sql_acl.cc	2008-03-25 12:52:52 +01:00
@@ -558,6 +558,8 @@ my_bool acl_reload(THD *thd)
   tables[0].next_local= tables[0].next_global= tables+1;
   tables[1].next_local= tables[1].next_global= tables+2;
   tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_READ;
+  tables[0].skip_temporary= tables[1].skip_temporary=
+    tables[2].skip_temporary= TRUE;
 
   if (simple_open_n_lock_tables(thd, tables))
   {
@@ -3528,7 +3530,8 @@ my_bool grant_reload(THD *thd)
   tables[0].next_local= tables[0].next_global= tables+1;
   tables[1].next_local= tables[1].next_global= tables+2;
   tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= TL_READ;
-
+  tables[0].skip_temporary= tables[1].skip_temporary=
+    tables[2].skip_temporary= TRUE;
   /*
     To avoid deadlocks we should obtain table locks before
     obtaining LOCK_grant rwlock.
Thread
bk commit into 5.0 tree (thek:1.2595) BUG#33275kpettersson25 Mar