Hi there,

I found a curious bug, which is caused by three compounding issues:

1. the orig_url column is a varchar(255), which should of course be varchar(2048). Why? Because web URLs can be 2048 characters (official microsoft Iexplorer Limit) *

2. If you have a URL, for example an url_encoded Japanese www.amazon.jp link, which is way longer than 255 characters, the URL cannot be stored (at least not if you are running MySQL strict, I'm sure)

3. The Shorturl module does not throw a warning and stops. Instead, it re-reads the url-alias table, and tries to insert the url again. Only to fail again, and the cycle starts over, which causes a never-ending loop.

In a minute or two, my system tried to create a failing shorturl alias for about half a million times, without stopping :))

So I propose two fixes:

- fix short_url.install and set varchar(2048) for orig_url
- if you cannot create a short_url, mark it as "broken" and skip it, and throw a watchdog message, to prevent eternal loopings

* Not many people know this, or want to know this, but yes it's really true, web urls have a maximum limit of 2048 characters, imposed by microsoft internet explorer. Other browsers like firefox can potentially handle more, but as long as msie can't, nobody has a use for it

Comments

Anonymous’s picture

This is the URL I was talking about (affiliate tag is replaced with xxxxx, no worries, im not spamming)

http://www.amaz on.co.jp/FX%E3%83%97%E3%83%AA%E3%83%B3%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0-%E3%83%88%E3%83%8A%E3%83%BC%E3%82%AB%E3%83%BC%E3%83%88%E3%83%AA%E3%83%83%E3%82%B8-%E5%A4%A7%E5%AE%B9%E9%87%8F%E3%83%9E%E3%82%BC%E3%83%B3%E3%82%BF-Phaser-016-1801-00/dp/B00004Z8XP?SubscriptionId=AKIAIFUFDVXMX7GWEJ6A&tag=xxxxxx&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B00004Z8XP

Its very long > 255

anonymous07’s picture

Subscribe

irakli’s picture

@morningtime,

thanks for reporting this bug.

varchars longer than 255 are supported only in MySQL versions 5.0.3 and later. I guess it's fair to add that requirement, since supporting long URLs is more important than supporting old DB engines.

Does anybody remember what's the MySQL version being installed by default RedHat ES/CentOS yum repo? I think it is, indeed, newer than 5.0.3, but I can't remember off of my head.

Thanks.

irakli’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.