Bug #13969 Routines which are replicated from master can't be executed on slave
Submitted: 12 Oct 2005 17:06 Modified: 12 Oct 2005 21:10
Reporter: Dmitry Lenev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0-bk-20051007 OS:Linux (Linux/Any)
Assigned to: Dmitry Lenev CPU Architecture:Any

[12 Oct 2005 17:06] Dmitry Lenev
Description:
Routine which was successfully created on master and CREATE PROCEDURE statement for which were successfully replicated to slave can not be executed on slave. This can cause problems in situations when slave is used for fail-over.

How to repeat:
# Test for mysql-test-run program which demonstrates problem
# Should be named rpl_something.test and run as part of standard MySQL's test-suite
source include/master-slave.inc;

create table t1 (a varchar(100));
create procedure foo()
  not deterministic
  reads sql data
  select * from t1;

sync_slave_with_master;
# This gives "ERROR HY000: There is not @ registered"
call foo();

Suggested fix:
This problem will be completely solved once WL#2897 "Complete definer support in the stored
routines" will be implemented. Meanwhile as workaround we should not abort execution of suid stored routine if its definer does not exist, instead we should run it under invoker security context.
[12 Oct 2005 19:01] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30974
[12 Oct 2005 19:41] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30976
[12 Oct 2005 21:10] Dmitry Lenev
Fixed in 5.0.15.
ChangeLog note is not needed since bug only present in unreleased version.