diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-03-01 12:41:49 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-03-01 12:41:49 +0100 |
commit | 22a504f89794f6517bc091b8d1f945b9aece7c18 (patch) | |
tree | 6c2bb074e63c752293c83176d894bfc3d57fb3b9 /sql/log_event.h | |
parent | 4e8bb265fef04c0e331dc78bdfdda6b41e918dfd (diff) | |
parent | 9313032283f1650d11fb36066f31d966e8492bdc (diff) | |
download | mariadb-git-22a504f89794f6517bc091b8d1f945b9aece7c18.tar.gz |
Merge MWL#234: @@skip_replication feature to MariaDB 5.5.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index 2f8854dd488..22e28c7ae13 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -505,6 +505,19 @@ struct sql_ex_info #define LOG_EVENT_RELAY_LOG_F 0x40 /** + @def LOG_EVENT_SKIP_REPLICATION_F + + Flag set by application creating the event (with @@skip_replication); the + slave will skip replication of such events if + --replicate-events-marked-for-skip is not set to REPLICATE. + + This is a MariaDB flag; we allocate it from the end of the available + values to reduce risk of conflict with new MySQL flags. +*/ +#define LOG_EVENT_SKIP_REPLICATION_F 0x8000 + + +/** @def OPTIONS_WRITTEN_TO_BIN_LOG OPTIONS_WRITTEN_TO_BIN_LOG are the bits of thd->options which must @@ -701,6 +714,11 @@ typedef struct st_print_event_info uint charset_database_number; uint thread_id; bool thread_id_printed; + /* + Track when @@skip_replication changes so we need to output a SET + statement for it. + */ + int skip_replication; st_print_event_info(); @@ -993,8 +1011,8 @@ public: /** Some 16 flags. See the definitions above for LOG_EVENT_TIME_F, - LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, and - LOG_EVENT_SUPPRESS_USE_F for notes. + LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, + LOG_EVENT_SUPPRESS_USE_F, and LOG_EVENT_SKIP_REPLICATION_F for notes. */ uint16 flags; @@ -4143,6 +4161,8 @@ public: m_message.str= NULL; /* Just as a precaution */ m_message.length= 0; set_direct_logging(); + /* Replicate the incident irregardless of @@skip_replication. */ + flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } @@ -4153,6 +4173,8 @@ public: DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message= msg; set_direct_logging(); + /* Replicate the incident irregardless of @@skip_replication. */ + flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } #endif |