title: MySQL Error 1118 (Row size too large) when restoring Django-mailer database
body: <p>I dumped a working production database from a django app and am trying to migrate it to my local development environment.  The production server runs MySQL 5.1, and locally I have 5.6.</p>
  
  <p>When migrating the django-mailer's "messagelog" table, I'm running into the dreaded Error 1118:</p>
  
  <p><code>ERROR 1118 (42000) at line 2226: Row size too large (&gt; 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.</code></p>
  
  <p>I've read lots of stuff online about this error, but none of it has solved my problem.</p>
  
  <p>N.B. This error is <strong>not</strong> coming from the creation of the table, but rather the insertion of a row with pretty large data.</p>
  
  <p>Notes:</p>
  
  <ol>
  <li>The innodb_file_format and innodb_file_format_max variables are set to Barracuda.</li>
  <li>The ROW_FORMAT is set to DYNAMIC on table creation.</li>
  <li><p>The table does not have very many columns.  Schema below:</p>
  
  <p><code>+----------------+------------+------+-----+---------+----------------+
  | Field          | Type       | Null | Key | Default | Extra          |
  +----------------+------------+------+-----+---------+----------------+
  | id             | int(11)    | NO   | PRI | NULL    | auto_increment |
  | message_data   | longtext   | NO   |     | NULL    |                |
  | when_added     | datetime   | NO   |     | NULL    |                |
  | priority       | varchar(1) | NO   |     | NULL    |                |
  | when_attempted | datetime   | NO   |     | NULL    |                |
  | result         | varchar(1) | NO   |     | NULL    |                |
  | log_message    | longtext   | NO   |     | NULL    |                |
  +----------------+------------+------+-----+---------+----------------+</code></p></li>
  </ol>
  
  <p>Again, the error happens ONLY when I try to insert a quite large (message_data is about 5 megabytes) row; creating the table works fine, and about 500,000 rows are added just fine before the failure.</p>
  
  <p>I'm out of ideas; I've tried DYANMIC and COMPRESSED row formats, and I've triple checked the values of the relevant innodb variables:</p>
  
  <p><code>mysql&gt; show variables like "%innodb_file%";
  +--------------------------+-----------+
  | Variable_name            | Value     |
  +--------------------------+-----------+
  | innodb_file_format       | Barracuda |
  | innodb_file_format_check | ON        |
  | innodb_file_format_max   | Barracuda |
  | innodb_file_per_table    | ON        |
  +--------------------------+-----------+</code></p>
  
  <p>The creation code (from SHOW CREATE TABLE) looks like:</p>
  
  <p><code>CREATE TABLE `mailer_messagelog` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `message_data` longtext NOT NULL,
    `when_added` datetime NOT NULL,
    `priority` varchar(1) NOT NULL,
    `when_attempted` datetime NOT NULL,
    `result` varchar(1) NOT NULL,
    `log_message` longtext NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=869906 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC</code></p>