Rechercher dans le manuel MySQL
17.4.1.16 Replication of Invoked Features
Replication of invoked features such as user-defined functions (UDFs) 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, the effects 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 warning Statement is not safe to log in statement format. For example, trying to replicate a UDF with statement-based replication generates this warning because it currently cannot be determined by the MySQL server whether the UDF 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 EVENT
andALTER EVENT
:The status of the event is set to
SLAVESIDE_DISABLED
on the slave regardless of the state specified (this does not apply toDROP EVENT
).The master on which the event was created is identified on the slave by its server ID. The
ORIGINATOR
column inINFORMATION_SCHEMA.EVENTS
and theoriginator
column inmysql.event
store this information. See Section 25.10, “The INFORMATION_SCHEMA EVENTS Table”, and Section 13.7.6.18, “SHOW EVENTS Syntax”, for more information.
The feature implementation resides on the slave in a renewable state so that if the master fails, the slave can be used as the master 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 replication master), query the
INFORMATION_SCHEMA.EVENTS
table in
a manner similar to what is shown here:
Alternatively, you can use the SHOW
EVENTS
statement, like this:
When promoting a replication slave having such events to a
replication master, you must enable each event using
ALTER EVENT
, where
event_name
ENABLEevent_name
is the name of the event.
If more than one master was involved in creating events on this
slave, and you wish to identify events that were created only on
a given master having the server ID
master_id
, modify the previous query
on the EVENTS
table to include the
ORIGINATOR
column, as shown here:
- FROM INFORMATION_SCHEMA.EVENTS
You can employ ORIGINATOR
with the
SHOW EVENTS
statement in a
similar fashion:
Before enabling events that were replicated from the master, you
should disable the MySQL Event Scheduler on the slave (using a
statement such as SET GLOBAL event_scheduler =
OFF;
), run any necessary ALTER
EVENT
statements, restart the server, then re-enable
the Event Scheduler on the slave afterward (using a statement
such as SET GLOBAL event_scheduler = ON;
)-
If you later demote the new master back to being a replication
slave, you must disable manually all events enabled by the
ALTER EVENT
statements. You can
do this by storing in a separate table the event names from the
SELECT
statement shown
previously, or using ALTER EVENT
statements to rename the events with a common prefix such as
replicated_
to identify them.
If you rename the events, then when demoting this server back to
being a replication slave, you can identify the events by
querying the EVENTS
table, as shown
here:
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-replication-features-invoked.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.