<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="replication-features-truncate">
      </a>
      19.5.1.37 Replication and TRUNCATE TABLE
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045134868688">
  </a>
  <a class="indexterm" name="idm46045134867200">
  </a>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   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
   <code class="literal">
    ROW
   </code>
   or
   <code class="literal">
    MIXED
   </code>
   . However this caused issues when
        logging or replicating, in
   <code class="literal">
    STATEMENT
   </code>
   or
   <code class="literal">
    MIXED
   </code>
   mode, tables that used transactional
        storage engines such as
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   when
        the transaction isolation level was
   <code class="literal">
    READ
        COMMITTED
   </code>
   or
   <code class="literal">
    READ UNCOMMITTED
   </code>
   ,
        which precludes statement-based logging.
  </p>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is treated for
        purposes of logging and replication as DDL rather than DML so
        that it can be logged and replicated as a statement. However,
        the effects of the statement as applicable to
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   and other transactional
        tables on replicas still follow the rules described in
   <a class="xref" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    Section 15.1.37, “TRUNCATE TABLE Statement”
   </a>
   governing such tables. (Bug
        #36763)
  </p>
 </div>
 <br/>
</div>
