I am afraid that this is not true. Procedures, triggers and functions will be dumped in all
configured databases or none at all. Please note that there is no option
which controls whether VIEWs are dumped. VIEWs are just like tables as far as MySQL is concerned. I assume you meant the "Dump PROCEDUREs, FUNCTIONs and TRIGGERs" option instead.
Most likely you are using a database user with insufficient privileges. That's why you see dumping the entities work in one database but not the other. I have run tests with 3 different database, using 3 different users, each one having access only to one specific database
. So User A can't dump entities from Database B just like User B can't dump entities from Database A. Only User A can dump entities from Database A and only User B can dump entities from Database B. I ran several tests confirming that using the correct user for each database does work as intended. Moreover I confirmed that using the wrong user for each database indeed results in no entities being dumped, exactly as it should happen (because MySQL won't let you violate its security model).
Let's recap. In order for procedures, triggers and functions to be dumped all of the following MUST be true:
- Use the Native MySQL backup engine as your Database backup engine. The reverse engineering engine does not have support for anything besides simple tables and views.
- Dump PROCEDUREs, FUNCTIONs and TRIGGERs must be checked. Obviously :)
- No dependency tracking must be unchecked (cleared). If you have told the backup engine to not perform dependency tracking it won't attempt to dump advanced entities which reference other tables / entities because your database would probably be impossible to restore (e.g. if the entity references a table or entity not yet created during restoration, something the dependency tracking is designed to fix).
- The database user you are using to dump the database MUST be either the owner of the PROCEDURE / FUNCTION or have SELECT privileges to the mysql.proc table per the MySQL documentation. This is a low level security feature of MySQL and cannot be circumvented.
- The database user you are using to dump the database MUST have the TRIGGER privilege on the table the TRIGGER is associated with per the MySQL documentation. This is a low level security feature of MySQL and cannot be circumvented.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!