summaryrefslogtreecommitdiff
path: root/sql/rpl_injector.cc
diff options
context:
space:
mode:
authormats@romeo.(none) <>2007-03-29 20:31:09 +0200
committermats@romeo.(none) <>2007-03-29 20:31:09 +0200
commit7c187c2c9b0e5ba8796f5499d14ee13543a941ec (patch)
tree94a9332e96292bf9e0fa153652b4fe3ab60db14c /sql/rpl_injector.cc
parentb3ade670a681b312437dc29c2c51f1f6344ab3f4 (diff)
downloadmariadb-git-7c187c2c9b0e5ba8796f5499d14ee13543a941ec.tar.gz
WL#3464: Add replication event to denote gap in replication
Adding an event that can be used to denote that an incident occured on the master. The event can be used to denote a gap in the replication stream, but can also be used to denote other incidents. In addition, the injector interface is extended with functions to generate an incident event. The function will also rotate the binary log after generating an incident event to get a fresh binary log.
Diffstat (limited to 'sql/rpl_injector.cc')
-rw-r--r--sql/rpl_injector.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index 95b5ecba895..b22b052a105 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -188,3 +188,21 @@ void injector::new_trans(THD *thd, injector::transaction *ptr)
DBUG_VOID_RETURN;
}
+
+int injector::record_incident(THD *thd, Incident incident)
+{
+ Incident_log_event ev(thd, incident);
+ if (int error= mysql_bin_log.write(&ev))
+ return error;
+ mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
+ return 0;
+}
+
+int injector::record_incident(THD *thd, Incident incident, LEX_STRING message)
+{
+ Incident_log_event ev(thd, incident, message);
+ if (int error= mysql_bin_log.write(&ev))
+ return error;
+ mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
+ return 0;
+}