We are using multi-source replication and observed in
MDEV-10652 that stored procedures are replicated unconditionally.
The setup includes:
1. ROW-based binary logs at masters. Masters are MySQL 5.6 at AWS RDS and standalone MariaDB 10.1.x.
2. Slave channel configuration:
What seems correct: changes to the foo database are replicated, changes to the mysql database or any other databases are ignored, GRANT, REVOKE are ignored, procedures bound to the foo database are replicated (DROP PROCEDURE foo.xxx, CREATE PROCEDURE foo.xxx, etc.).
What seems wrong: procedures bound to other databases are replicated as well regardless of replication options. E. i. DROP PROCEDURE mysql.yyy and CREATE PROCEDURE mysql.yyy is executed on the slave.
I tried various replication options like do-db, ignore-db and setting default database before working with procedures on the master, and this made no difference. E. g.:
I think since the user managment commands (GRANT, REVOKE) are ignored in this setup, procedures bound to other databases should be ignored as well.
Usage of sql_log_bin=0; is not an option, because it may require the SUPER privilege and would break other slaves that are supposed to replicate the entire master. Same for @@skip_replication which is in addition a MariaDB-specific feature.