List:Internals« Previous MessageNext Message »
From:dlenev Date:October 12 2005 9:02pm
Subject:bk commit into 5.0 tree (dlenev:1.2030) BUG#13969
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of dlenev. When dlenev 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.2030 05/10/12 23:01:41 dlenev@stripped +3 -0
  Temporary solution for bug #13969 "Routines which are replicated from master
  can't be executed on slave". It will be possible to solve this problem
  in more correct way when we will implement WL#2897 "Complete definer support
  in the stored routines".

  sql/sp_head.cc
    1.189 05/10/12 23:01:29 dlenev@stripped +15 -0
    sp_change_security_context():
      Until we won't properly replicate information about stored routine
      definer with stored routine creation statement all stored routines
      on slave are created under ''@'' definer. Therefore we won't be able
      to run any routine which was replicated from master on slave server
      if we will emit error in this function. This will cause big problems
      for users who use slave for fail-over. So until we will fully implement
      WL#2897 "Complete definer support in the stored routines" we run suid
      stored routines for which we were unable to find definer under invoker
      security context.

  mysql-test/t/rpl_sp.test
    1.7 05/10/12 23:01:29 dlenev@stripped +17 -0
    Added test for bug #13969 "Routines which are replicated from master can't be
    executed on slave".

  mysql-test/r/rpl_sp.result
    1.9 05/10/12 23:01:29 dlenev@stripped +8 -0
    Added test for bug #13969 "Routines which are replicated from master can't be
    executed on slave".

# 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:	dlenev
# Host:	brandersnatch.site
# Root:	/home/dlenev/src/mysql-5.0-repl

--- 1.8/mysql-test/r/rpl_sp.result	2005-09-15 23:29:00 +04:00
+++ 1.9/mysql-test/r/rpl_sp.result	2005-10-12 23:01:29 +04:00
@@ -264,6 +264,14 @@
 select * from t1;
 a
 1
+create procedure foo()
+not deterministic
+reads sql data
+select * from t1;
+call foo();
+a
+1
+drop procedure foo;
 drop function fn1;
 drop database mysqltest1;
 drop user "zedjzlcsjhd"@127.0.0.1;

--- 1.6/mysql-test/t/rpl_sp.test	2005-09-01 19:04:16 +04:00
+++ 1.7/mysql-test/t/rpl_sp.test	2005-10-12 23:01:29 +04:00
@@ -258,6 +258,23 @@
 select * from t1;
 
 
+#
+# Test for bug #13969 "Routines which are replicated from master can't be
+# executed on slave".
+# 
+connection master;
+create procedure foo()
+  not deterministic
+  reads sql data
+  select * from t1;
+sync_slave_with_master;
+# This should not fail
+call foo();
+connection master;
+drop procedure foo;
+sync_slave_with_master;
+
+
 # Clean up
 connection master;
 drop function fn1;

--- 1.188/sql/sp_head.cc	2005-09-26 20:21:53 +04:00
+++ 1.189/sql/sp_head.cc	2005-10-12 23:01:29 +04:00
@@ -2650,9 +2650,24 @@
                                 sp->m_definer_host.str,
                                 sp->m_db.str))
     {
+#ifdef NOT_YET_REPLICATION_SAFE
+      /*
+        Until we won't properly replicate information about stored routine
+        definer with stored routine creation statement all stored routines
+        on slave are created under ''@'' definer. Therefore we won't be able
+        to run any routine which was replicated from master on slave server
+        if we will emit error here. This will cause big problems for users
+        who use slave for fail-over. So until we will fully implement
+        WL#2897 "Complete definer support in the stored routines" we run
+        suid stored routines for which we were unable to find definer under
+        invoker security context.
+      */
       my_error(ER_NO_SUCH_USER, MYF(0), sp->m_definer_user.str,
                sp->m_definer_host.str);
       return TRUE;
+#else
+      return FALSE;
+#endif
     }
     *backup= thd->security_ctx;
     thd->security_ctx= &sp->m_security_ctx;
Thread
bk commit into 5.0 tree (dlenev:1.2030) BUG#13969dlenev12 Oct