When you have a MySQL statement-based replication and you create a stored procedure that modify some rows (INSERT, UPDATE, DELETE commands…), What is really replicated on the slave when you call this procedure on the master ? The CALL himself or the commands (INSERT, UPDATE, DELETE…) inside the procedure ?
For example, create such a procedure:
delimiter |
CREATE PROCEDURE myproc ()
BEGIN
DELETE FROM mytable LIMIT 1;
END |
delimiter ;
Then call on the master:
master> CALL myproc();
=> does it replicates "CALL myproc()" or "DELETE FROM mytable LIMIT 1" ?
Best Answer
In short, no, your CALL is not replicated
You can take a look into the FAQ starting from B.4.22 and the Binary Logging of Stored Programs
B.4.23: Are stored procedures and functions created on a master server replicated to a slave?
B.4.24: How are actions that take place inside stored procedures and functions replicated?