Bug #63507 | Error Code 1118: Row size too large - even though it is not. | ||
---|---|---|---|
Submitted: | 30 Nov 2011 13:36 | Modified: | 11 Dec 2012 22:05 |
Reporter: | Floris Steenkamp | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.5.18, 5.1.61, 5.0 | OS: | Any (Windows 7 and Vista) |
Assigned to: | CPU Architecture: | Any | |
Tags: | InnoDB;Row size too large;BLOB |
[30 Nov 2011 13:36]
Floris Steenkamp
[30 Nov 2011 13:38]
Floris Steenkamp
MySQL Script to repeat problem
Attachment: Bug.txt (text/plain), 8.37 KiB.
[1 Dec 2011 17:22]
Sveta Smirnova
Thank you for the report. Verified as described. Manual says at http://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html: ----<q>---- # The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT), is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes. LONGBLOB and LONGTEXT columns must be less than 4GB, and the total row length, including BLOB and TEXT columns, must be less than 4GB. If a row is less than half a page long, all of it is stored locally within the page. If it exceeds half a page, variable-length columns are chosen for external off-page storage until the row fits within half a page, as described in Section 13.3.12.2, “File Space Management”. ----</q>---- I think this explains why you get this error, but you should not, because you store data in BLOB columns. Workaround: use new InnoDB file format Barracuda and row_format=DYNAMIC
[1 Dec 2011 17:31]
Sveta Smirnova
Another workaround: switch data type for a1 from CHAR to VARCHAR
[11 Dec 2012 22:05]
John Russell
Added to changelog for 5.1.66, 5.5.29, 5.6.7: The error message was improved for the case where an UPDATE failed because the row included several BLOB values greater than 768 bytes each, causing the size of a row to exceed half the page size. The old message, was misleading; it suggested using BLOBs, when the 768-byte prefix for each BLOB column was the cause of the limit error: Error Code 1118: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs A workaround for the problem was to create the table with the ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED clause, which is now suggested in the message.