urls in database are only 255 char. UI should reflect this constraint. Are 255 characters enough?

This is
http://news.google.com/news?hl=en&ned=us&q=vanilla+ice+cream+drupal&ie=U...
characters.

Comments

greg_y’s picture

Category: bug » feature

I'll second this -- the 255 character limitation IS a problem. I wrote at http://drupal.org/node/70201 (re Aggregator) that

"I have already run across some feed URLs that don't fit in that (255 char) field length. For instance, I can't use custom Amazon feeds created here (http://www.onfocus.com/amafeed/) because they run about 350 characters. I'd imagine that with more and more on-the-fly RSS feeds -- such as Google News -- the 255 char limit will become more and more of a problem."

I saw that both Aggregator and Aggregator2 use the field types VARCHAR (and CHAR?), which apparently were limited to 255 characters prior to mySQL 4.1.3. I don't know enough to suggest a better alternative ...

alex_b’s picture

Version: » master

your argument is convincing.

here is what i would do: convert the 'link' field in the leech_news_feed table from varchar(255) to longtext with an index over the first 255 characters.

when doing that, we should also convert the 'link' field in the leech_news_item in the same go. this is the field that holds the link to an original article.

i will look into this, but am a bit under time pressure now. if somebody's in a hurry: please go ahead :)

-alex

alex_b’s picture

Status: Active » Fixed

Feed URLs with up to 2048 characters and feed item URLs with virtually any length allowed now. See latest HEAD version, commits http://drupal.org/cvs?commit=45856 and http://drupal.org/cvs?commit=45857. To convert your existing DB use:

ALTER TABLE `leech` DROP index `url`;
ALTER TABLE `leech` CHANGE `url` `url` TEXT NOT NULL DEFAULT '';
ALTER TABLE `leech` ADD UNIQUE `url` ( `url` ( 255 ) ) ;

ALTER TABLE `leech_news_item` DROP index `link`;
ALTER TABLE `leech_news_item` CHANGE `link` `link` TEXT NOT NULL DEFAULT '';
ALTER TABLE `leech_news_item` ADD INDEX `link` ( `link` ( 255 ) ) ;
Anonymous’s picture

Status: Fixed » Closed (fixed)