<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="innodb-deadlock-example">
      </a>
      17.7.5.1 An InnoDB Deadlock Example
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045163825408">
  </a>
  <a class="indexterm" name="idm46045163823952">
  </a>
  <p>
   The following example illustrates how an error can occur when a
        lock request causes a deadlock. The example involves two
        clients, A and B.
  </p>
  <p>
   InnoDB status contains details of the last deadlock. For
        frequent deadlocks, enable global variable
   <a class="link" href="innodb-parameters.html#sysvar_innodb_print_all_deadlocks">
    <code class="literal">
     innodb_print_all_deadlocks
    </code>
   </a>
   .
        This adds deadlock information to the error log.
  </p>
  <p>
   Client A enables
   <a class="link" href="innodb-parameters.html#sysvar_innodb_print_all_deadlocks">
    <code class="literal">
     innodb_print_all_deadlocks
    </code>
   </a>
   ,
        creates two tables, 'Animals' and 'Birds', and inserts data into
        each. Client A begins a transaction, and selects a row in
        Animals in share mode:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa77079206"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> innodb_print_all_deadlocks <span class="token operator">=</span> <span class="token keyword">ON</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> Animals <span class="token punctuation">(</span><span class="token keyword">name</span> <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span> <span class="token keyword">value</span> <span class="token datatype">INT</span><span class="token punctuation">)</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> InnoDB<span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.01 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> Birds <span class="token punctuation">(</span><span class="token keyword">name</span> <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span> <span class="token keyword">value</span> <span class="token datatype">INT</span><span class="token punctuation">)</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> InnoDB<span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.01 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> Animals <span class="token punctuation">(</span><span class="token keyword">name</span><span class="token punctuation">,</span><span class="token keyword">value</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token string">"Aardvark"</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 1 row affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> Birds <span class="token punctuation">(</span><span class="token keyword">name</span><span class="token punctuation">,</span><span class="token keyword">value</span><span class="token punctuation">)</span> <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token string">"Buzzard"</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 1 row affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">START</span> <span class="token keyword">TRANSACTION</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token keyword">value</span> <span class="token keyword">FROM</span> Animals <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Aardvark'</span> <span class="token keyword">FOR</span> <span class="token keyword">SHARE</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> value <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>    10 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   Next, client B begins a transaction, and selects a row in Birds
        in share mode:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa94758810"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">START</span> <span class="token keyword">TRANSACTION</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token keyword">value</span> <span class="token keyword">FROM</span> Birds <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Buzzard'</span> <span class="token keyword">FOR</span> <span class="token keyword">SHARE</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> value <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>    20 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   The Performance Schema shows the locks after the two select
        statements:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa53599641"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ENGINE_TRANSACTION_ID <span class="token keyword">as</span> Trx_Id<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>     OBJECT_NAME <span class="token keyword">as</span> <span class="token punctuation">`</span><span class="token keyword">Table</span><span class="token punctuation">`</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     INDEX_NAME <span class="token keyword">as</span> <span class="token punctuation">`</span><span class="token keyword">Index</span><span class="token punctuation">`</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_DATA <span class="token keyword">as</span> <span class="token keyword">Data</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_MODE <span class="token keyword">as</span> <span class="token keyword">Mode</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_STATUS <span class="token keyword">as</span> <span class="token keyword">Status</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_TYPE <span class="token keyword">as</span> <span class="token keyword">Type</span> 
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>data_locks<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Trx_Id          <span class="token punctuation">|</span> Table   <span class="token punctuation">|</span> Index   <span class="token punctuation">|</span> Data       <span class="token punctuation">|</span> Mode          <span class="token punctuation">|</span> Status  <span class="token punctuation">|</span> Type   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 421291106147544 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span> NULL       <span class="token punctuation">|</span> IS            <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> TABLE  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 421291106147544 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 'Aardvark' <span class="token punctuation">|</span> S,REC_NOT_GAP <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> RECORD <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 421291106148352 <span class="token punctuation">|</span> Birds   <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span> NULL       <span class="token punctuation">|</span> IS            <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> TABLE  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 421291106148352 <span class="token punctuation">|</span> Birds   <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 'Buzzard'  <span class="token punctuation">|</span> S,REC_NOT_GAP <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> RECORD <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   Client B then updates a row in Animals:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa6443280"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">UPDATE</span> Animals <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">30</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Aardvark'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Client B has to wait. The Performance Schema shows the wait for
        a lock:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa77296941"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> REQUESTING_ENGINE_LOCK_ID <span class="token keyword">as</span> Req_Lock_Id<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>     REQUESTING_ENGINE_TRANSACTION_ID <span class="token keyword">as</span> Req_Trx_Id<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>     BLOCKING_ENGINE_LOCK_ID <span class="token keyword">as</span> Blk_Lock_Id<span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     BLOCKING_ENGINE_TRANSACTION_ID <span class="token keyword">as</span> Blk_Trx_Id
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>data_lock_waits<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Req_Lock_Id                            <span class="token punctuation">|</span> Req_Trx_Id <span class="token punctuation">|</span> Blk_Lock_Id                            <span class="token punctuation">|</span> Blk_Trx_Id      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129437696:27:4:2:139816016601240 <span class="token punctuation">|</span>      43260 <span class="token punctuation">|</span> 139816129436888:27:4:2:139816016594720 <span class="token punctuation">|</span> 421291106147544 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ENGINE_LOCK_ID <span class="token keyword">as</span> Lock_Id<span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     ENGINE_TRANSACTION_ID <span class="token keyword">as</span> Trx_id<span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     OBJECT_NAME <span class="token keyword">as</span> <span class="token punctuation">`</span><span class="token keyword">Table</span><span class="token punctuation">`</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     INDEX_NAME <span class="token keyword">as</span> <span class="token punctuation">`</span><span class="token keyword">Index</span><span class="token punctuation">`</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_DATA <span class="token keyword">as</span> <span class="token keyword">Data</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_MODE <span class="token keyword">as</span> <span class="token keyword">Mode</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_STATUS <span class="token keyword">as</span> <span class="token keyword">Status</span><span class="token punctuation">,</span> 
<span class="token prompt">    -&gt;</span>     LOCK_TYPE <span class="token keyword">as</span> <span class="token keyword">Type</span> 
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>data_locks<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Lock_Id                                <span class="token punctuation">|</span> Trx_Id          <span class="token punctuation">|</span> Table   <span class="token punctuation">|</span> Index   <span class="token punctuation">|</span> Data       <span class="token punctuation">|</span> Mode          <span class="token punctuation">|</span> Status  <span class="token punctuation">|</span> Type   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129437696:1187:139816016603896   <span class="token punctuation">|</span>           43260 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span> NULL       <span class="token punctuation">|</span> IX            <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> TABLE  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129437696:1188:139816016603808   <span class="token punctuation">|</span>           43260 <span class="token punctuation">|</span> Birds   <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span> NULL       <span class="token punctuation">|</span> IS            <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> TABLE  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129437696:28:4:2:139816016600896 <span class="token punctuation">|</span>           43260 <span class="token punctuation">|</span> Birds   <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 'Buzzard'  <span class="token punctuation">|</span> S,REC_NOT_GAP <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> RECORD <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129437696:27:4:2:139816016601240 <span class="token punctuation">|</span>           43260 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 'Aardvark' <span class="token punctuation">|</span> X,REC_NOT_GAP <span class="token punctuation">|</span> WAITING <span class="token punctuation">|</span> RECORD <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129436888:1187:139816016597712   <span class="token punctuation">|</span> 421291106147544 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span> NULL       <span class="token punctuation">|</span> IS            <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> TABLE  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 139816129436888:27:4:2:139816016594720 <span class="token punctuation">|</span> 421291106147544 <span class="token punctuation">|</span> Animals <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 'Aardvark' <span class="token punctuation">|</span> S,REC_NOT_GAP <span class="token punctuation">|</span> GRANTED <span class="token punctuation">|</span> RECORD <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">6 rows in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   InnoDB only uses sequential transaction ids when a transaction
        attempts to modify the database. Thererfore, the previous
        read-only transaction id changes from 421291106148352 to 43260.
  </p>
  <p>
   If client A attempts to update a row in Birds at the same time,
        this will lead to a deadlock:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa27811988"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">UPDATE</span> Birds <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">40</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Buzzard'</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1213 (40001)<span class="token punctuation">:</span> Deadlock found when trying to get lock; try restarting transaction</span></code></pre>
  </div>
  <p>
   InnoDB rolls back the transaction that caused the deadlock. The
        first update, from Client B, can now proceed.
  </p>
  <p>
   The Information Schema contains the number of deadlocks:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64799645"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token punctuation">`</span>count<span class="token punctuation">`</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_METRICS
          <span class="token keyword">WHERE</span> <span class="token keyword">NAME</span><span class="token operator">=</span><span class="token string">"lock_deadlocks"</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> count <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>     1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   The InnoDB status contains the following information about the
        deadlock and transactions. It also shows that the read-only
        transaction id 421291106147544 changes to sequential transaction
        id 43261.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68710737"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">ENGINE</span> INNODB <span class="token keyword">STATUS</span><span class="token punctuation">;</span>
<span class="token comment" spellcheck="true">------------------------</span>
LATEST DETECTED DEADLOCK
<span class="token comment" spellcheck="true">------------------------</span>
<span class="token number">2022</span><span class="token operator">-</span><span class="token number">11</span><span class="token operator">-</span><span class="token number">25</span> <span class="token number">15</span>:<span class="token number">58</span>:<span class="token number">22</span> <span class="token number">139815661168384</span>
<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">TRANSACTION</span>:
<span class="token keyword">TRANSACTION</span> <span class="token number">43260</span><span class="token punctuation">,</span> <span class="token keyword">ACTIVE</span> <span class="token number">186</span> sec <span class="token keyword">starting</span> <span class="token keyword">index</span> <span class="token keyword">read</span>
mysql <span class="token keyword">tables</span> <span class="token keyword">in</span> <span class="token keyword">use</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">locked</span> <span class="token number">1</span>
<span class="token keyword">LOCK</span> <span class="token keyword">WAIT</span> <span class="token number">4</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
MySQL thread id <span class="token number">19</span><span class="token punctuation">,</span> OS thread handle <span class="token number">139815619204864</span><span class="token punctuation">,</span> <span class="token keyword">query</span> id <span class="token number">143</span> localhost u2 updating
<span class="token keyword">UPDATE</span> Animals <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">30</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Aardvark'</span>

<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> HOLDS THE <span class="token keyword">LOCK</span><span class="token punctuation">(</span>S<span class="token punctuation">)</span>:
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">28</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Birds<span class="token punctuation">`</span> trx id <span class="token number">43260</span> <span class="token keyword">lock</span> <span class="token keyword">mode</span> S <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">42757a7a617264</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Buzzard<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8fb</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e40110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">80000014</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>


<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> WAITING <span class="token keyword">FOR</span> THIS <span class="token keyword">LOCK</span> <span class="token keyword">TO</span> BE GRANTED:
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">27</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Animals<span class="token punctuation">`</span> trx id <span class="token number">43260</span> lock_mode X <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap waiting
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">8</span><span class="token punctuation">;</span> hex <span class="token number">416172647661726b</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Aardvark<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8f9</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e20110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">8000000a</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>


<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token keyword">TRANSACTION</span>:
<span class="token keyword">TRANSACTION</span> <span class="token number">43261</span><span class="token punctuation">,</span> <span class="token keyword">ACTIVE</span> <span class="token number">209</span> sec <span class="token keyword">starting</span> <span class="token keyword">index</span> <span class="token keyword">read</span>
mysql <span class="token keyword">tables</span> <span class="token keyword">in</span> <span class="token keyword">use</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">locked</span> <span class="token number">1</span>
<span class="token keyword">LOCK</span> <span class="token keyword">WAIT</span> <span class="token number">4</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
MySQL thread id <span class="token number">18</span><span class="token punctuation">,</span> OS thread handle <span class="token number">139815618148096</span><span class="token punctuation">,</span> <span class="token keyword">query</span> id <span class="token number">146</span> localhost u1 updating
<span class="token keyword">UPDATE</span> Birds <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">40</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Buzzard'</span>

<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span> HOLDS THE <span class="token keyword">LOCK</span><span class="token punctuation">(</span>S<span class="token punctuation">)</span>:
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">27</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Animals<span class="token punctuation">`</span> trx id <span class="token number">43261</span> <span class="token keyword">lock</span> <span class="token keyword">mode</span> S <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">8</span><span class="token punctuation">;</span> hex <span class="token number">416172647661726b</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Aardvark<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8f9</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e20110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">8000000a</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>


<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span> WAITING <span class="token keyword">FOR</span> THIS <span class="token keyword">LOCK</span> <span class="token keyword">TO</span> BE GRANTED:
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">28</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Birds<span class="token punctuation">`</span> trx id <span class="token number">43261</span> lock_mode X <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap waiting
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">42757a7a617264</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Buzzard<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8fb</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e40110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">80000014</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>

<span class="token operator">*</span><span class="token operator">*</span><span class="token operator">*</span> WE ROLL BACK <span class="token keyword">TRANSACTION</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token comment" spellcheck="true">------------</span>
TRANSACTIONS
<span class="token comment" spellcheck="true">------------</span>
Trx id counter <span class="token number">43262</span>
<span class="token keyword">Purge</span> done <span class="token keyword">for</span> trx's n:o <span class="token operator">&lt;</span> <span class="token number">43256</span> <span class="token keyword">undo</span> n:o <span class="token operator">&lt;</span> <span class="token number">0</span> state: running but idle
<span class="token keyword">History</span> <span class="token keyword">list</span> length <span class="token number">0</span>
<span class="token keyword">LIST</span> <span class="token keyword">OF</span> TRANSACTIONS <span class="token keyword">FOR</span> <span class="token keyword">EACH</span> <span class="token keyword">SESSION</span>:
<span class="token comment" spellcheck="true">---TRANSACTION 421291106147544, not started</span>
<span class="token number">0</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">0</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true">---TRANSACTION 421291106146736, not started</span>
<span class="token number">0</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">0</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true">---TRANSACTION 421291106145928, not started</span>
<span class="token number">0</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">0</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true">---TRANSACTION 43260, ACTIVE 219 sec</span>
<span class="token number">4</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">undo</span> log entries <span class="token number">1</span>
MySQL thread id <span class="token number">19</span><span class="token punctuation">,</span> OS thread handle <span class="token number">139815619204864</span><span class="token punctuation">,</span> <span class="token keyword">query</span> id <span class="token number">143</span> localhost u2</code></pre>
  </div>
  <p>
   The error log contains this information about transactions and
        locks:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa10622455"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token variable">@@log_error</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> @@log_error         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> /var/log/mysqld.log <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span>

<span class="token keyword">TRANSACTION</span> <span class="token number">43260</span><span class="token punctuation">,</span> <span class="token keyword">ACTIVE</span> <span class="token number">186</span> sec <span class="token keyword">starting</span> <span class="token keyword">index</span> <span class="token keyword">read</span>
mysql <span class="token keyword">tables</span> <span class="token keyword">in</span> <span class="token keyword">use</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">locked</span> <span class="token number">1</span>
<span class="token keyword">LOCK</span> <span class="token keyword">WAIT</span> <span class="token number">4</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
MySQL thread id <span class="token number">19</span><span class="token punctuation">,</span> OS thread handle <span class="token number">139815619204864</span><span class="token punctuation">,</span> <span class="token keyword">query</span> id <span class="token number">143</span> localhost u2 updating
<span class="token keyword">UPDATE</span> Animals <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">30</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Aardvark'</span>
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">28</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Birds<span class="token punctuation">`</span> trx id <span class="token number">43260</span> <span class="token keyword">lock</span> <span class="token keyword">mode</span> S <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">42757a7a617264</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Buzzard<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8fb</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e40110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">80000014</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>

RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">27</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Animals<span class="token punctuation">`</span> trx id <span class="token number">43260</span> lock_mode X <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap waiting
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">8</span><span class="token punctuation">;</span> hex <span class="token number">416172647661726b</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Aardvark<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8f9</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e20110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">8000000a</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>

<span class="token keyword">TRANSACTION</span> <span class="token number">43261</span><span class="token punctuation">,</span> <span class="token keyword">ACTIVE</span> <span class="token number">209</span> sec <span class="token keyword">starting</span> <span class="token keyword">index</span> <span class="token keyword">read</span>
mysql <span class="token keyword">tables</span> <span class="token keyword">in</span> <span class="token keyword">use</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">locked</span> <span class="token number">1</span>
<span class="token keyword">LOCK</span> <span class="token keyword">WAIT</span> <span class="token number">4</span> <span class="token keyword">lock</span> struct<span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">,</span> heap size <span class="token number">1128</span><span class="token punctuation">,</span> <span class="token number">2</span> <span class="token keyword">row</span> <span class="token keyword">lock</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
MySQL thread id <span class="token number">18</span><span class="token punctuation">,</span> OS thread handle <span class="token number">139815618148096</span><span class="token punctuation">,</span> <span class="token keyword">query</span> id <span class="token number">146</span> localhost u1 updating
<span class="token keyword">UPDATE</span> Birds <span class="token keyword">SET</span> <span class="token keyword">value</span><span class="token operator">=</span><span class="token number">40</span> <span class="token keyword">WHERE</span> <span class="token keyword">name</span><span class="token operator">=</span><span class="token string">'Buzzard'</span>
RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">27</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Animals<span class="token punctuation">`</span> trx id <span class="token number">43261</span> <span class="token keyword">lock</span> <span class="token keyword">mode</span> S <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">8</span><span class="token punctuation">;</span> hex <span class="token number">416172647661726b</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Aardvark<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8f9</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e20110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">8000000a</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span>

RECORD <span class="token keyword">LOCKS</span> space id <span class="token number">28</span> <span class="token keyword">page</span> <span class="token keyword">no</span> <span class="token number">4</span> n bits <span class="token number">72</span> <span class="token keyword">index</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">of</span> <span class="token keyword">table</span> <span class="token punctuation">`</span>test<span class="token punctuation">`</span><span class="token punctuation">.</span><span class="token punctuation">`</span>Birds<span class="token punctuation">`</span> trx id <span class="token number">43261</span> lock_mode X <span class="token keyword">locks</span> rec but <span class="token operator">not</span> gap waiting
Record <span class="token keyword">lock</span><span class="token punctuation">,</span> heap <span class="token keyword">no</span> <span class="token number">2</span> PHYSICAL RECORD: n_fields <span class="token number">4</span><span class="token punctuation">;</span> <span class="token keyword">compact</span> <span class="token keyword">format</span><span class="token punctuation">;</span> info bits <span class="token number">0</span>
 <span class="token number">0</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">42757a7a617264</span><span class="token punctuation">;</span> <span class="token keyword">asc</span> Buzzard<span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">1</span>: len <span class="token number">6</span><span class="token punctuation">;</span> hex <span class="token number">00000000a8fb</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>       <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">2</span>: len <span class="token number">7</span><span class="token punctuation">;</span> hex <span class="token number">82000000e40110</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>        <span class="token punctuation">;</span><span class="token punctuation">;</span>
 <span class="token number">3</span>: len <span class="token number">4</span><span class="token punctuation">;</span> hex <span class="token number">80000014</span><span class="token punctuation">;</span> <span class="token keyword">asc</span>     <span class="token punctuation">;</span><span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
