title: MySQL Assertion Failure in thread
body: <p>Why does this Query Fails?</p>
  
  <pre><code>SELECT
      SUB_COMMODITY,
      `VOL` AS Sales,
      `VOL_CHANGE` AS Dollar_change,
      `VOL_SHARE` AS Dollar_share,
      `VOL_SHARE_CHANGE` AS Dollar_share_change,
      `U_VOL` AS Unit_sales,
      `UVOL_CHANGE` AS Unit_change,
      `UVOL_SHARE` AS Unit_share,
      `UVOL_SHARE_CHANGE` AS Unit_share_change,
      `VOL_MKT_SHARE` AS Market_share,
      `PERIOD`
  FROM `calculatedsummary`
  WHERE WEEK = 52
  AND PERIOD BETWEEN '2012-03-01' AND '2012-03-31'
  AND MKT = '000 Total Market'
  AND COMMODITY = 'CONDIMENTS SAUCES'
  AND SUB_COMMODITY = 'BBQ SAUCE'
  AND BRAND_FAMILY_DESC = 'Total'
  AND session_id = 'ADBCDEFGHIJQLMNOPQRSTUVWXYZ'
  </code></pre>
  
  <p>MySQL server log:</p>
  
  <ul>
  <li>InnoDB: Assertion failure in thread 2292 in file row0sel.c line 2441</li>
  <li>InnoDB: Failing assertion: buf + data_len &lt;= original_buf + buf_len</li>
  <li>InnoDB: We intentionally generate a memory trap. </li>
  <li>InnoDB: Submit a detailed bug report to <a href="http://bugs.mysql.com" rel="nofollow">http://bugs.mysql.com</a>. </li>
  <li>InnoDB: If you get repeated assertion failures or crashes, even </li>
  <li>InnoDB: immediately after the mysqld startup, there may be </li>
  <li>InnoDB: corruption in the</li>
  <li>InnoDB  tablespace. Please refer to </li>
  <li>InnoDB: <a href="http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html</a></li>
  <li>InnoDB: about forcing recovery. </li>
  <li>InnoDB: Thread 1544 stopped in file os0sync.c line 474 </li>
  <li>InnoDB: Thread 2028 stopped in file os0sync.c line 781</li>
  </ul>
  
  <p>And also get a #2013 error - Lost connection to MySQL server during query</p>
  
  <p>But if I change </p>
  
  <blockquote>
    <blockquote>
      <p><strong>session_id = 'ADBCDEFGHIJQLMNOPQRSTUVWXYZ'</strong> </p>
      
      <p>TO</p>
      
      <p><strong>session_id LIKE '%ADBCDEFGHIJQLMNOPQRSTUVWXYZ%'</strong></p>
    </blockquote>
  </blockquote>