Hi,

I am not sure if this issue is caused by pathauto or not. But with pathauto enabled, saving a new content with title in utf8 would cause the following warning:

user warning: Data too long for column 'link' at row 1 query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (4, 'content', '@type: added %title.', 'a:2:{s:5:\"@type\";s:4:\"blog\";s:6:\"%title\";s:89:\"ทดสอบภาษาไทย อันนั้นหายยังหว่า\";}', 5, '<a href=\"/drupal/th/content/blog-entry/registered/17-%E0%B8%97%E0%B8%94%E0%B8%AA%E0%B8%AD%E0%B8%9A%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2-%E0%B8%AD%E0%B8%B1%E0%B8%99%E0%B8%99%E0%B8%B1%E0%B9%89%E0%B8%99%E0%B8%AB%E0%B8%B2%E0%B8%A2%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B8%AB%E0%B8%A7%E0%B9%88%E0%B8%B2\">แสดง</a>', 'http://localhost/drupal/th/node/add/blog', 'http://localhost/drupal/th/node/add/blog', '127.0.0.1', 1229507309) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\modules\dblog\dblog.module on line 144.

Comments

greggles’s picture

Title: Data too long for column 'link' » Data too long for column 'link' in watchdog table
Project: Pathauto » Drupal core
Version: 6.x-1.x-dev » 7.x-dev
Component: I18n stuff » watchdog.module

The problem is that the data is too long for the "watchdog" table's link column.

http://www.boutell.com/newfaq/misc/urllength.html shows information for different browsers and web servers. Apache's limit s 4,000 characters. IE is 2083 characters. We should probably increase the link column to handle more information, though 2000 seems excessive. I think 200 or even 500 would probably be fine?

Also, you can use the Pathauto configuration under General Settings to limit the length of the URL which is 255 characters.

ball.in.th’s picture

Just wanna add that my Maximum alias length in pathauto was 100 and didn't prevent the warning. I guess pathauto counts the number of utf8 characters before getting converted to a proper URL. In my case, the title was in Thai and 1 Thai character takes 3 bytes in utf8 and, I think, 9 bytes to encode to a URL.

greggles’s picture

If all of your urls are in Thai then you could adjust the setting down to some smaller number.

I'm not sure if it makes sense for Pathauto to check the length of the urlencoded url.

ball.in.th’s picture

Just got another idea. As 1 non-western , e.g. Thai or Japanese, utf8 character takes lots of bytes in an URL encoded format, the URL could get really long easily. It might be better to store the link column and all URL columns, in the database in utf8 and automagically convert to and from URL encoding as needed. 255 is still not long enough though.

Dave Reid’s picture

Status: Active » Closed (duplicate)

This has now been fixed by #223298: Change {dblog}.type VARCHAR limit from 16 to 64 which performs a substr() on the link to fit it into the database column.

etomilin’s picture

Version: 7.x-dev » 6.19
Status: Closed (duplicate) » Active

I'm not sure that using substr() on a link is a good idea, since it makes link useless.
This issue becomes really annoing if you use utf characters in urls, since almost any link of quite reasonable length exceeds 255 char's limit due to URL encoding.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.