Search code examples
mysqlinnodbtemp-tables

Cannot add field...row size...greater than maximum allowed size


I'm seeing the following error in my MySQL logs:

[Warning] InnoDB: Cannot add field `wd_field_ft_95_240` in table `tmp`.`#sql_1_0` because after adding it, the row size is 8155 which is greater than maximum allowed size (8126) for a record on index leaf page.

Is this tmp database some kind of internal MySQL structure? Is this something I need to care about?


Solution

  • Some MySQL queries create internal temporary tables to hold partial results.

    As of MySQL 5.7.6, the default storage engine for internal temporary tables is InnoDB, which has a pretty small limit on row size, as you can see (though BLOB/TEXT columns can go beyond that limit).

    You can go back to the old pre-5.7 default storage engine for internal temporary tables:

     internal_tmp_disk_storage_engine=MyISAM
    

    This is the workaround mentioned in this bug: "Bug #77398 row size too large in mysql 5.7 query"