PDF (A4) - 40.9Mb
Man Pages (TGZ) - 261.1Kb
Man Pages (Zip) - 368.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
Replication of invoked features such as loadable functions and stored programs (stored procedures and functions, triggers, and events) provides the following characteristics:
The effects of the feature are always replicated.
The following statements are replicated using statement-based replication:
However, theeffects of features created, modified, or dropped using these statements are replicated using row-based replication.
NoteAttempting to replicate invoked features using statement-based replication produces the warningStatement is not safe to log in statement format. For example, trying to replicate a loadable function with statement-based replication generates this warning because it currently cannot be determined by the MySQL server whether the function is deterministic. If you are absolutely certain that the invoked feature's effects are deterministic, you can safely disregard such warnings.
In the case of
CREATE EVENTandALTER EVENT:The status of the event is set to
REPLICA_SIDE_DISABLEDon the replica regardless of the state specified (this does not apply toDROP EVENT).The source on which the event was created is identified on the replica by its server ID. The
ORIGINATORcolumn inINFORMATION_SCHEMA.EVENTSstores this information. SeeSection 15.7.7.20, “SHOW EVENTS Statement”, for more information.
The feature implementation resides on the replica in a renewable state so that if the source fails, the replica can be used as the source without loss of event processing.
To determine whether there are any scheduled events on a MySQL server that were created on a different server (that was acting as a source), query the Information SchemaEVENTS table in a manner similar to what is shown here:
SELECT EVENT_SCHEMA, EVENT_NAME FROM INFORMATION_SCHEMA.EVENTS WHERE STATUS = 'REPLICA_SIDE_DISABLED'; Alternatively, you can use theSHOW EVENTS statement, like this:
SHOW EVENTS WHERE STATUS = 'REPLICA_SIDE_DISABLED'; When promoting a replica having such events to a source, you must enable each event usingALTER EVENT, whereevent_name ENABLEevent_name is the name of the event.
If more than one source was involved in creating events on this replica, and you wish to identify events that were created only on a given source having the server IDsource_id, modify the previous query on theEVENTS table to include theORIGINATOR column, as shown here:
SELECT EVENT_SCHEMA, EVENT_NAME, ORIGINATOR FROM INFORMATION_SCHEMA.EVENTS WHERE STATUS = 'REPLICA_SIDE_DISABLED' AND ORIGINATOR = 'source_id' You can employORIGINATOR with theSHOW EVENTS statement in a similar fashion:
SHOW EVENTS WHERE STATUS = 'REPLICA_SIDE_DISABLED' AND ORIGINATOR = 'source_id'REPLICA_SIDE_DISABLED replacesSLAVESIDE_DISABLED, which is deprecated.
Before enabling events that were replicated from the source, you should disable the MySQL Event Scheduler on the replica (using a statement such asSET GLOBAL event_scheduler = OFF;), run any necessaryALTER EVENT statements, restart the server, then re-enable the Event Scheduler on the replica afterward (using a statement such asSET GLOBAL event_scheduler = ON;)-
If you later demote the new source back to being a replica, you must disable manually all events enabled by theALTER EVENT statements. You can do this by storing in a separate table the event names from theSELECT statement shown previously, or usingALTER EVENT statements to rename the events with a common prefix such asreplicated_ to identify them.
If you rename the events, then when demoting this server back to being a replica, you can identify the events by querying theEVENTS table, as shown here:
SELECT CONCAT(EVENT_SCHEMA, '.', EVENT_NAME) AS 'Db.Event' FROM INFORMATION_SCHEMA.EVENTS WHERE INSTR(EVENT_NAME, 'replicated_') = 1;PDF (A4) - 40.9Mb
Man Pages (TGZ) - 261.1Kb
Man Pages (Zip) - 368.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb