Author: jstephens
Date: 2009-02-12 12:07:00 +0100 (Thu, 12 Feb 2009)
New Revision: 13713
Log:
Documented fix for Replication Bug #36763
Updated TRUNCATE TABLE SYntax
Added new TRUNCATE subsection to replication-features
Made depend
Modified:
trunk/dynamic-docs/changelog/mysqld-1.xml
trunk/refman-5.1/Makefile.depends
trunk/refman-5.1/replication-notes.xml
trunk/refman-5.1/sql-syntax-data-manipulation.xml
trunk/topic-guides/topics-5.1/Makefile.depends
Modified: trunk/dynamic-docs/changelog/mysqld-1.xml
===================================================================
--- trunk/dynamic-docs/changelog/mysqld-1.xml 2009-02-12 03:29:37 UTC (rev 13712)
+++ trunk/dynamic-docs/changelog/mysqld-1.xml 2009-02-12 11:07:00 UTC (rev 13713)
Changed blocks: 1, Lines Added: 78, Lines Deleted: 0; 3123 bytes
@@ -9,6 +9,84 @@
<logentry entrytype="bug">
<tags>
+ <highlight type="replication"/>
+ <manual type="binlog"/>
+ <manual type="STATEMENT mode"/>
+ <manual type="MIXED mode"/>
+ <manual type="TRUNCATE"/>
+ <manual type="InnoDB"/>
+ <manual type="READ COMMITTED"/>
+ <manual type="READ UNCOMMITTED"/>
+ </tags>
+
+ <bugs>
+ <fixes bugid="36763"/>
+ </bugs>
+
+ <versions>
+ <version ver="5.1.32"/>
+ </versions>
+
+ <message>
+
+ <para>
+ <literal role="stmt">TRUNCATE</literal> statements failed to
+ replicate when statement-based binary logging mode was not
+ available. The issue was observed when using
+ <literal role="se">InnoDB</literal> with the transaction
+ isolation level set to <literal>READ UNCOMMITTED</literal> (thus
+ forcing <literal role="se">InnoDB</literal> not to allow
+ statement-based logging). However, the same behavior could be
+ reproduced using any transactional storage engine supporting
+ only row-based logging, regardless of the isolation level. This
+ was due to two separate problems:
+ </para>
+
+ <orderedlist>
+
+ <listitem>
+ <para>
+ An error was printed by <literal role="se">InnoDB</literal>
+ for <literal role="stmt">TRUNCATE</literal> when using
+ statement-based logging mode where the transaction isolation
+ level was set to <literal>READ COMMITTED</literal> or
+ <literal>READ UNCOMMITTED</literal>, because
+ <literal role="se">InnoDB</literal> permits statement-based
+ replication for DML statements. However,
+ <literal role="stmt">TRUNCATE</literal> is not
+ transactional; since it is the equivalent of
+ <literal role="se">DROP TABLE</literal> followed by
+ <literal role="stmt">CREATE TABLE</literal>, it is actually
+ DDL, and should therefore be allowed to be replicated as a
+ statement.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal role="stmt">TRUNCATE</literal> was not logged in
+ mixed mode because of the error just described; however,
+ this error was not reported to the client.
+ </para>
+ </listitem>
+
+ </orderedlist>
+
+ <para>
+ As a result of this fix, <literal role="stmt">TRUNCATE</literal>
+ is now treated as DDL for purposes of binary logging and
+ replication; that is, it is always logged as a statement and so
+ no longer causes an error when replicated using a transactional
+ storage engine such as <literal role="se">InnoDB</literal>.
+ </para>
+
+ </message>
+
+ </logentry>
+
+ <logentry entrytype="bug">
+
+ <tags>
<highlight type="cluster"/>
</tags>
Modified: trunk/refman-5.1/Makefile.depends
===================================================================
--- trunk/refman-5.1/Makefile.depends 2009-02-12 03:29:37 UTC (rev 13712)
+++ trunk/refman-5.1/Makefile.depends 2009-02-12 11:07:00 UTC (rev 13713)
Changed blocks: 2, Lines Added: 2, Lines Deleted: 0; 1068 bytes
@@ -4433,6 +4433,7 @@
../refman-5.1/metadata/replication-solutions.idmap \
../refman-5.1/metadata/se-innodb-core.idmap \
../refman-5.1/metadata/se-memory-core.idmap \
+ ../refman-5.1/metadata/sql-syntax-data-manipulation.idmap \
../refman-5.1/metadata/sql-syntax-replication.idmap \
../refman-5.1/metadata/sql-syntax-server-administration.idmap \
../refman-5.1/metadata/sql-syntax-transactions.idmap \
@@ -4543,6 +4544,7 @@
../refman-5.1/metadata/replication-solutions.idmap \
../refman-5.1/metadata/se-innodb-core.idmap \
../refman-5.1/metadata/se-memory-core.idmap \
+ ../refman-5.1/metadata/sql-syntax-data-manipulation.idmap \
../refman-5.1/metadata/sql-syntax-replication.idmap \
../refman-5.1/metadata/sql-syntax-server-administration.idmap \
../refman-5.1/metadata/sql-syntax-transactions.idmap \
Modified: trunk/refman-5.1/replication-notes.xml
===================================================================
--- trunk/refman-5.1/replication-notes.xml 2009-02-12 03:29:37 UTC (rev 13712)
+++ trunk/refman-5.1/replication-notes.xml 2009-02-12 11:07:00 UTC (rev 13713)
Changed blocks: 1, Lines Added: 31, Lines Deleted: 0; 1809 bytes
@@ -2016,6 +2016,37 @@
</section>
+ <section id="replication-features-truncate">
+
+ <title>Replication and <literal role="stmt">TRUNCATE</literal></title>
+
+ <para>
+ <literal role="stmt">TRUNCATE</literal> is normally regarded as
+ a DML statement, and so would be expected to be logged and
+ replicated using row-based format when the binary logging mode
+ is <literal>ROW</literal> or <literal>MIXED</literal>. However
+ this caused issues when logging or replicating, in
+ <literal>STATEMENT</literal> or <literal>MIXED</literal> mode,
+ tables that used transactional storage engines such as
+ <literal role="se">InnoDB</literal> when the transaction
+ isolation level was <literal>READ COMMITTED</literal> or
+ <literal>READ UNCOMMITTED</literal>, which precludes
+ statement-based logging.
+ </para>
+
+ <para>
+ Beginning with MySQL 5.1.32,
+ <literal role="stmt">TRUNCATE</literal> is treated for purposes
+ of logging and replication DDL rather than DML so that it can be
+ logged and replicated as a statement. However, the effects of
+ the statement as applicable to
+ <literal role="se">InnoDB</literal> and other transactional
+ tables on replication slaves still follow the rules described in
+ <xref linkend="truncate"/> governing such tables. (Bug #36763)
+ </para>
+
+ </section>
+
<section id="replication-features-variables">
<title>Replication and Variables</title>
Modified: trunk/refman-5.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.1/sql-syntax-data-manipulation.xml 2009-02-12 03:29:37 UTC (rev 13712)
+++ trunk/refman-5.1/sql-syntax-data-manipulation.xml 2009-02-12 11:07:00 UTC (rev 13713)
Changed blocks: 1, Lines Added: 18, Lines Deleted: 0; 1430 bytes
@@ -7849,6 +7849,24 @@
</para>
<para>
+ Beginning with MySQL 5.1.32,
+ <literal role="stmt">TRUNCATE</literal> is treated for purposes of
+ binary logging and replication as <literal role="stmt">DROP
+ TABLE</literal> followed by <literal role="stmt">CREATE
+ TABLE</literal> — that is, as DDL rather than DML. This is
+ due to the fact that, when using
+ <literal role="se">InnoDB</literal> and other transactional
+ storage engines where the transaction isolation level does not
+ allow for statement-based logging (<literal>READ
+ COMMITTED</literal> or <literal>READ UNCOMMITTED</literal>), the
+ statement was not logged and replicated when using
+ <literal>STATEMENT</literal> or <literal>MIXED</literal> logging
+ mode. (Bug #36763) However, it is still applied on replication
+ slaves using <literal role="se">InnoDB</literal> in the manner
+ described previously.
+ </para>
+
+ <para>
The count of rows affected by
<literal role="stmt" condition="truncate">TRUNCATE TABLE</literal>
is accurate only when it is mapped to a
Modified: trunk/topic-guides/topics-5.1/Makefile.depends
===================================================================
--- trunk/topic-guides/topics-5.1/Makefile.depends 2009-02-12 03:29:37 UTC (rev 13712)
+++ trunk/topic-guides/topics-5.1/Makefile.depends 2009-02-12 11:07:00 UTC (rev 13713)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 0; 727 bytes
@@ -432,6 +432,7 @@
../../refman-5.1/metadata/replication-solutions.idmap \
../../refman-5.1/metadata/se-innodb-core.idmap \
../../refman-5.1/metadata/se-memory-core.idmap \
+ ../../refman-5.1/metadata/sql-syntax-data-manipulation.idmap \
../../refman-5.1/metadata/sql-syntax-replication.idmap \
../../refman-5.1/metadata/sql-syntax-server-administration.idmap \
../../refman-5.1/metadata/sql-syntax-transactions.idmap \
Thread |
---|
• svn commit - mysqldoc@docsrva: r13713 - in trunk: dynamic-docs/changelog refman-5.1 topic-guides/topics-5.1 | jon.stephens | 12 Feb |