Download & Extend

Row size too large MySQL error when adding multiple link fields to single content type

Project:Link
Version:6.x-2.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Following instructions on setup and importing the uprofile.full.export I get the error

user warning: 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 query: ALTER TABLE content_type_uprofile ADD `field_favorite3_url` VARCHAR(2048) DEFAULT NULL in [my-site]/includes/database.mysql-common.inc on line 298.

Comments

#1

Project:Advanced Profile Kit» Content Construction Kit (CCK)
Version:6.x-1.0-beta3» 6.x-2.x-dev
Component:Code» content_copy.module
Category:bug report» support request

My best guess is something is wrong with how your database is set up but, beyond that, no clue. Moving this over to the CCK queue as this is a content copy issue and maybe they have an idea why the import isn't working for you.

Michelle

#2

subscribed

#3

Same issue here.

EDIT: Importing "uprofile.basic-stats.export" worked fine, it was the full file that makes it blow up.

#4

The field it's complaining about isn't in the basic import. It's one of the three favorite site links, which are link fields, so the problem could be there as well.

Michelle

#5

same problem here. First one "uprofile.basic-stats" went fine, as already said.
"uprofile.contact-links" and "uprofile.full" get same error, as stated.

user warning: 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 query: ALTER TABLE content_type_uprofile ADD `field_favorite3_url` VARCHAR(2048) DEFAULT NULL in [mysite]\includes\database.mysql-common.inc on line 298.

If I now try to delete the new content type there's also an error:

user warning: Can't DROP 'field_favorite3_url'; check that column/key exists query: ALTER TABLE content_type_uprofile DROP field_favorite3_url in [mysite]\includes\database.mysql-common.inc on line 322.

by the way: The Page manager "user_view" shows a few errors in it's content, that the type is missing.

thanks in advance

#6

Hi Michelle,

Another puzzling issue. As I mentioned previously, I imported "uprofile.basic-stats.export" with no problem. I then tried importing "uprofile.contact-links.export" and received the error. I deleted the uprofile type, got the "Can't DROP" error as in #5, imported "uprofile.basic-stats.export" again and then edited "uprofile.contact-links.export" to remove field_favorite3 and it worked fine.

Since the import code for field_favorite1, 2 & 3 look the same, it is a bit curious.

A temporary work-around seems to be to remove the field_favorite3 entry from the file and import just the 2 fields.

Rachel

#7

This has been working fine and I haven't changed the export in some time so all I can think of is something changed in either CCK or Link.

I plan to rework the exports, soon, anyway, so this may be a moot point once I do that. We'll see. Without knowing what's wrong, I have no idea if the changes I have planned will have the side effect of fixing this.

Michelle

#8

The new CCK came out 2010-Jun-16 and the new Link on 2010-Jun-14. Something might have changed in one of those. I don't suppose you've tried an import since those came out?

I don't think its worth a lot of time to troubleshoot since you are going to be reworking the exports.

I can post my edited "uprofile.contact-links.export" if you'd like and if someone confirms it works for them we can move on.

Rachel

#9

Title:After importing uprofile.full.export get error user warning: Row size too large. The maximum row size for the used table type...» A Sulution to the imports !
Project:Content Construction Kit (CCK)» Advanced Profile Kit
Version:6.x-2.x-dev» 6.x-1.0-beta3
Component:content_copy.module» Code
Category:support request» task
Assigned to:Anonymous» AlphaGrowl
Status:active» patch (to be ported)

It seems as if the Link module always gives a command to create varchar(2048), which is unnecessarily long. Summing all of these link fields up leads to more than the max. capacity of a row. Now how to fix this ? Don't worry, only 3 Steps to fix this ...

1. go on and add the uprofile_full.txt. Please ignore the error msg, if it tells you:
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 query: ALTER TABLE content_type_uprofile ADD `field_favorite3_url` VARCHAR(2048)
don't panic, this will be fixed in a moment ... and you won't have to be short a field!

2. log in to MySQL and choose to enter SQL Commands to enter:

ALTER TABLE `content_type_uprofile` CHANGE `field_homepage_url` `field_homepage_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_blog_url` `field_blog_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_facebook_url` `field_facebook_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_twitter_url` `field_twitter_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_friendfeed_url` `field_friendfeed_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_linkedin_url` `field_linkedin_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_myspace_url` `field_myspace_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_favorite1_url` `field_favorite1_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8__general_ci NULL DEFAULT NULL, CHANGE `field_favorite1_ur2` `field_favorite1_ur2` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8__general_ci NULL DEFAULT NULL, ALTER TABLE content_type_uprofile ADD `field_favorite3_url` VARCHAR(1024) DEFAULT NULL

3. Now go back to your page and see that this problem is fixed, even if you enter lots and lots of new fields!

Stay true and contribute ;-)

AttachmentSize
uprofile_full.txt 53.26 KB

#10

Title:A Sulution to the imports !» Row size too large error when importing from content copy export
Project:Advanced Profile Kit» Link
Version:6.x-1.0-beta3» 6.x-2.9
Category:task» support request
Assigned to:AlphaGrowl» Anonymous
Status:patch (to be ported)» active

@emo4u.eu: I appreciate your enthusiasm but that isn't a patch and isn't something most people are going to want to do. This needs to be fixed at the source, which appears to be the Link module.

I'm not labeling this as a bug, yet, because I don't know what's going on. This export has been working fine for the last year or so and I have no clue why it would suddenly be acting up.

Moving this to the Link module queue to see if there's any suggestions there.

Michelle

#11

I'm rebuilding my development site and am in the process of installing APK on it. I just imported the full content type export with no issues. I'm guessing it has to do with specific database setups? Not really my area of expertise, I'm afraid.

Michelle

#12

Hmm... Now that's interesting. Since I'm reworking the uprofile node type, I deleted and then re-imported and the second time around I got that error. Really don't know what to make of this. I'd love it if the Link maintainer(s) could chime in here, especially with whether the field really needs to be that big.

Michelle

#13

The link maintainer is kind of enjoying the holiday off.

The field is that big because people said 256 was too small.

#14

Holiday off? What's that? ;)

Well, the APK maintainer is taking the holiday to get an RC out so I'm going to let the export stand as is and hopefully we'll get it sorted before the final release.

Have a good holiday. :)

Michelle

#15

Edit in link.module the constant LINK_URL_MAX_LENGTH (line 40) to the desired size. I'm using 256 but you could also use another value that is smaller then 2048.

#16

The script won't work. Corrections:

ALTER TABLE `content_type_uprofile` CHANGE `field_homepage_url` `field_homepage_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_blog_url` `field_blog_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_facebook_url` `field_facebook_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_twitter_url` `field_twitter_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_friendfeed_url` `field_friendfeed_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_linkedin_url` `field_linkedin_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_myspace_url` `field_myspace_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_favorite1_url` `field_favorite1_url` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `field_favorite2_url` `field_favorite1_ur2` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; ALTER TABLE content_type_uprofile ADD `field_favorite3_url` VARCHAR(1024) DEFAULT NULL

- collation __ instead of _ in some places
- field_favorite2 names were wrong.
- separation of the two alters with ; not ,

The above worked for me.
Though I agree with Michelle a better, code-wise alternative should be preferred.

#17

#15 fixed it for me – thanks!

#18

Indeed #15 worked for me too: for complex content types, a length of 2048 may be too high. Unfortunately it seems this has to be hardcoded, and if it was raised to 2048 because 256 was too short for some then I see no easy solution, unless there is a value in between that can be OK for everybody.

Should anyone prefer #15 in the form of a (trivial) patch against the latest 6.x-2.x branch, it is attached.

AttachmentSize
link-i838902-url-max-length.patch 317 bytes

#19

#15 worked for me too. I had to update all the existing fields in my DB, and re-save several of my fields to completely resolve my occurrence.

#20

Title:Row size too large error when importing from content copy export» Row size too large MySQL error when adding multiple link fields to single content type
Category:support request» bug report

This problem is not limited to the import of content - I just ran into it while adding link fields to a new content type (title adjusted accordingly). My error is as below:

User warning: 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 query: ALTER TABLE content_type_school ADD `field_school_edu_feat_url` VARCHAR(2048) DEFAULT NULL in _db_query() (line 148 of /var/www/drupal/includes/database.mysql.inc).

I can't see any good reason to make these url fields so large to begin with, so #15 will help there, but I also don't understand why these aren't text fields. Text fields aren't added up across rows. If we were to use text fields we wouldn't run into this problem at all.

#21

Hopefully this can help someone...
It seems the issue for me was that the LINK_URL_MAX_LENGTH was set to 2048 (which seemed to be too large) and I changed it to 256 and the error is no longer appearing.

define('LINK_URL_MAX_LENGTH', 256);

#22

#15 worked for me! I had 4 fields on my content type that were CCK fields of type "Link". I updated all of them at the database level to be VARCHAR (1024) and it's working now!