1

I have a very large entry type in craft with quite a few fields. I've been updating a single record on a regular basis but upon adding a few more paragraphs of rich text in a field, I received this error when trying to save:

Internal Server Error

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.

Is there some other solution beyond what the error is suggesting? Not sure what I'm missing. Any thoughts would be appreciated.

Thanks!

UPDATE 10/1

I was able to get the existing table in my Craft instance updated to the barracuda file format with row_format=DYNAMIC. Updated the global MySQL params as well:

+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Barracuda |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
| innodb_file_per_table    | ON        |
+--------------------------+-----------+

The problem now is with new matrix fields: the newly created tables are not being set to the row_format=DYNAMIC. Is there somewhere in Craft where I need to update this? Or is there somewhere else I need to update this?

3

You're running into a MySQL/InnoDB server limitation that commonly occurs with a significant number of columns in a single table.

Fortunately there are several documented workarounds for it:

https://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large

https://www.percona.com/blog/2011/04/07/innodb-row-size-limitation/

https://dba.stackexchange.com/questions/6598/innodb-create-table-error-row-size-too-large

From the Craft site, another workaround would be to re-think your information architecture. Currently most fields in Craft have their content stored in the craft_content table in the database, so when you have a lot of textual fields on the site, you'll see the error you're getting. The exception to this rule is Matrix fields, which get their own table where there content is stored.

If you can move any of those fields into Matrix fields where they make sense, you'll take them out of the craft_content table helping mitigate the issue.

  • Appreciate the quick answer Brad. I'll take a look at these and see what the best option is for my situation. BTW: Been a lurker on these forums for the last year+. Don't know what this community would do without you! – jooosh Sep 15 '15 at 21:55
  • So I was able to get the existing table in my Craft instance updated to the barracuda file format with row_format=DYNAMIC. Updated the global MySQL params as well: innodb_file_format = Barracuda, innodb_file_format_check = ON, innodb_file_format_max = Barracuda, innodb_file_per_table = ON. The problem now is with new matrix fields, that create new tables, are not being set to the row_format=DYNAMIC. Is there somewhere in Craft where I can set this? Thanks – jooosh Oct 1 '15 at 23:32
  • I think I missed the innodb_default_row_format param. Will confirm later and update my answer. – jooosh Oct 2 '15 at 0:10
  • innodb_default_row_format was introduced in MySQL 5.7.9. I'm running an earlier version. Looks like setting a default is not an option unless I upgrade. – jooosh Oct 2 '15 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.