MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jon Date:October 28 2008 9:27pm
Subject:svn commit - mysqldoc@docsrva: r12182 - in trunk: refman-5.1 refman-6.0
View as plain text  
Author: jstephens
Date: 2008-10-28 22:27:04 +0100 (Tue, 28 Oct 2008)
New Revision: 12182

Log:

Slave-side triggers aren't activated by statements run on the master
under RBR

Fixes Docs Bug #40328




Modified:
   trunk/refman-5.1/Makefile.depends
   trunk/refman-5.1/replication-notes.xml
   trunk/refman-5.1/restrictions.xml
   trunk/refman-6.0/Makefile.depends
   trunk/refman-6.0/replication-notes.xml
   trunk/refman-6.0/restrictions.xml


Modified: trunk/refman-5.1/Makefile.depends
===================================================================
--- trunk/refman-5.1/Makefile.depends	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-5.1/Makefile.depends	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 0; 640 bytes

@@ -3012,6 +3012,7 @@
 restrictions_SOURCES = restrictions.xml $(restrictions_INCLUDES)
 restrictions_IDMAPS = \
 	../refman-5.1/metadata/internationalization.idmap \
+	../refman-5.1/metadata/replication-notes.idmap \
 	../refman-5.1/metadata/restrictions.idmap \
 	../refman-5.1/metadata/sql-syntax-compound-statements.idmap \
 	../refman-5.1/metadata/sql-syntax-prepared-statements.idmap \


Modified: trunk/refman-5.1/replication-notes.xml
===================================================================
--- trunk/refman-5.1/replication-notes.xml	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-5.1/replication-notes.xml	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 35, Lines Deleted: 0; 1857 bytes

@@ -1878,6 +1878,41 @@
 
     </section>
 
+    <section id="replication-features-triggers">
+
+      <title>Replication and Triggers</title>
+
+      <para>
+        Triggers are not executed on the slave under row-based
+        replication. However they are are executed on the slave under
+        statement-based replication. Instead, when using row-based
+        replication, the changes caused by executing the trigger on the
+        master are applied on the slave.
+      </para>
+
+      <para>
+        This behavior is by design. The reason for this is that, if both
+        the master and the slave applied the changes from the master
+        and, in addition, the trigger causing these changes were applied
+        on the slave, the changes would in effect be applied twice on
+        the slave, leading to different data on the master and the
+        slave.
+      </para>
+
+      <para>
+        If you wish for triggers to execute on both the master and the
+        slave &mdash; perhaps because you have different triggers on the
+        master and slave &mdash; then you must use statement-based
+        replication. However, it is not necessary to use statement-based
+        replication exclusively if you want to enable slave-side
+        triggers; it is sufficient in such cases to switch to
+        statement-based replication only for those statements where you
+        want this effect, and to use row-based replication the rest of
+        the time.
+      </para>
+
+    </section>
+
     <section id="replication-features-variables">
 
       <title>Replication and Variables</title>


Modified: trunk/refman-5.1/restrictions.xml
===================================================================
--- trunk/refman-5.1/restrictions.xml	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-5.1/restrictions.xml	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 10, Lines Deleted: 0; 877 bytes

@@ -325,6 +325,16 @@
 
       <listitem>
         <para>
+          When using row-based replication, triggers on the slave are
+          not activated by statements originating on the master. This
+          does not apply when using statement-based replication. For
+          more information, see
+          <xref linkend="replication-features-triggers"/>.
+        </para>
+      </listitem>
+
+      <listitem>
+        <para>
           The <literal>RETURN</literal> statement is disallowed in
           triggers, which cannot return a value. To exit a trigger
           immediately, use the <literal>LEAVE</literal> statement.


Modified: trunk/refman-6.0/Makefile.depends
===================================================================
--- trunk/refman-6.0/Makefile.depends	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-6.0/Makefile.depends	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 0; 640 bytes

@@ -2177,6 +2177,7 @@
 restrictions_SOURCES = restrictions.xml $(restrictions_INCLUDES)
 restrictions_IDMAPS = \
 	../refman-6.0/metadata/internationalization.idmap \
+	../refman-6.0/metadata/replication-notes.idmap \
 	../refman-6.0/metadata/restrictions.idmap \
 	../refman-6.0/metadata/sql-syntax-compound-statements.idmap \
 	../refman-6.0/metadata/sql-syntax-prepared-statements.idmap \


Modified: trunk/refman-6.0/replication-notes.xml
===================================================================
--- trunk/refman-6.0/replication-notes.xml	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-6.0/replication-notes.xml	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 35, Lines Deleted: 0; 1857 bytes

@@ -1851,6 +1851,41 @@
 
     </section>
 
+    <section id="replication-features-triggers">
+
+      <title>Replication and Triggers</title>
+
+      <para>
+        Triggers are not executed on the slave under row-based
+        replication. However they are are executed on the slave under
+        statement-based replication. Instead, when using row-based
+        replication, the changes caused by executing the trigger on the
+        master are applied on the slave.
+      </para>
+
+      <para>
+        This behavior is by design. The reason for this is that, if both
+        the master and the slave applied the changes from the master
+        and, in addition, the trigger causing these changes were applied
+        on the slave, the changes would in effect be applied twice on
+        the slave, leading to different data on the master and the
+        slave.
+      </para>
+
+      <para>
+        If you wish for triggers to execute on both the master and the
+        slave &mdash; perhaps because you have different triggers on the
+        master and slave &mdash; then you must use statement-based
+        replication. However, it is not necessary to use statement-based
+        replication exclusively if you want to enable slave-side
+        triggers; it is sufficient in such cases to switch to
+        statement-based replication only for those statements where you
+        want this effect, and to use row-based replication the rest of
+        the time.
+      </para>
+
+    </section>
+
     <section id="replication-features-variables">
 
       <title>Replication and Variables</title>


Modified: trunk/refman-6.0/restrictions.xml
===================================================================
--- trunk/refman-6.0/restrictions.xml	2008-10-28 20:16:36 UTC (rev 12181)
+++ trunk/refman-6.0/restrictions.xml	2008-10-28 21:27:04 UTC (rev 12182)
Changed blocks: 1, Lines Added: 10, Lines Deleted: 0; 877 bytes

@@ -313,6 +313,16 @@
 
       <listitem>
         <para>
+          When using row-based replication, triggers on the slave are
+          not activated by statements originating on the master. This
+          does not apply when using statement-based replication. For
+          more information, see
+          <xref linkend="replication-features-triggers"/>.
+        </para>
+      </listitem>
+
+      <listitem>
+        <para>
           The <literal>RETURN</literal> statement is disallowed in
           triggers, which cannot return a value. To exit a trigger
           immediately, use the <literal>LEAVE</literal> statement.


Thread
svn commit - mysqldoc@docsrva: r12182 - in trunk: refman-5.1 refman-6.0jon28 Oct