1

I've got a 700MB dump file from a mysql database that I was trying to undump into a new install of MariaDB and I got this error

ERROR 1118 (42000) at line 7481: 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.

I got most of the tables to go through, but the table that doesn't want to pump through is kind of a strange one. It's got about 10 blob fields in it (none of which should be over 1000 bytes each because of what they're supposed to be used for in my program). The only other datatypes we've got are VARCHAR, CHAR, SMALLINT and INTEGER.

What I want to achieve is an automated way to convert MySQL to MariaDB so my customers can do the same thing. So, even if I fix this problem, I'd like to know exactly what the problem is and if I can fix it on the MariaDB installation or the MySQL dumping.

Our customers use MyISAM tables because of a few outlying cases we can work around (in case that makes a difference). Seems like MariaDB created all these tables as InnoDB tables.

The syntax I used for creating the dump file was just mysqldump.exe DatabaseName --compatible=mssql > DatabaseName.sql. I don't think the mssql compatibility causes issues, it was just a holdover I found in the batch file.

2
  • Also, the dump file is nearly a gigabyte and I can't edit it with emacs (exceeds buffer length), and the lines are so long that grep told me it was too confused to give my any info Jun 17, 2013 at 14:32
  • grep --text '^)[[:space:]]ENGINE' yourdumpfile.sql doesn't work? Also, what version of MySQL did the files originate from? Jun 17, 2013 at 23:55

1 Answer 1

1

InnoDB has Limitations on row lengths and BLOBs. According to the MySQL Documentation:

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 14.3.12.2, “File Space Management”.

Although InnoDB supports row sizes larger than 65,535 bytes internally, MySQL itself imposes a row-size limit of 65,535 for the combined size of all columns:

mysql> CREATE TABLE t (a VARCHAR(8000), b VARCHAR(10000),
-> c VARCHAR(10000), d VARCHAR(10000), e VARCHAR(10000),
-> f VARCHAR(10000), g VARCHAR(10000)) ENGINE=InnoDB; ERROR 1118 (42000):
Row size too large. The maximum row size for the used table
type, not counting BLOBs, is 65535. You have to change some columns to
TEXT or BLOBs

See Section E.10.4, “Limits on Table Column Count and Row Size”.

You are going to have to recreate the mysqldump so that the Storage Engine is Specified. Perhaps just drop the --compatible=mssql from the mysqldump command. The end result is the that the table will remain a MyISAM table when being imported into MariaDB.

This is just a guess but look at the error message you posted. If a BLOB prefix is 768 bytes and you have 10 BLOBs, that 7680 bytes. That leaves you with 320 bytes. If the remaining datatypes exceed 320 bytes, then it is impossible to convert to InnoDB.

Since a TEXT column is the variant of a BLOB, converting to TEXT does nothing since the storage requirements for TEXT and BLOB field are identical.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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