Welcome, Guest
Username: Password: Remember me

TOPIC: Install Error - 1118 Row size too large...

Install Error - 1118 Row size too large... 28 Apr 2015 15:17 #12951

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 414
  • Thank you received: 130
  • Karma: 46
Came across this one today... Not a Cook install error but may be worth making note about MYSQL row length limits

I had a table that i needed to recreate lots of string fields over 90 of them from an external data source (an old school flat file)... in a previous test project this table was built by Cook and Installed with out error... but i needed to create the same table in a new component so i went about creating this table again without further thought

I just did the usual drag and drop field types as needed... but this time i did not match the field lengths with my original flat file before building for download and local install. When i went to install i get the below error
1118 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...

So now I notice that I had not limited the field lengths all of my 90 string fields were set to the default length of 255 characters... at first I was unsure why it failed thinking 90*255 = 22,950 but some quick research finds that the 65535 value mentioned in the error is in fact bytes!

Our data base is in UTF-8 which takes up to 3 bytes per character and now it becomes apparent why such an error has occurred...

255 characters x 3 Bytes x 90 fields = 68850 bytes over 3000 bytes bigger than allowed

So as i said in the beginning NOT a Cook install issue but a limitation of the MYSQL (and poor database design if it were intended to leave all 90 fields at 255 characters)

P.S. Admin... I did not see it as needing a new ticket as i dont think its something that many of us would encounter frequently so just Posted directly in Trouble Shooting for reference
Last Edit: 28 Apr 2015 15:19 by BTB300.
The administrator has disabled public write access.

Install Error - 1118 Row size too large... 29 Apr 2015 16:57 #12954

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Hey, amazing, I am actually precisely working on that.

You remember the issue with the UNIQUE statement limit.
So, to fix it and prevent from that directly in the interface, I had to take all these things in consideration.
MySAM or InnoDB, latin or utf8...
I discovered also that utf8 is not real utf-8 which takes 4 bytes instead of 3.
They invented the utf8 because most of the time the last byte is not used.

All this is in the box of the new version and it is prepared to count easily the bytes.
I will include this proposal you make here later because I need to go on, But just to know that the interface now can take all this in consideration at a framework level. I only need to code easy stuff to include your idea.

For the moment, the builder will not lock the field lenght. Only the Unique statement issue is handled.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.086 seconds

Get Started