[drupal-devel] [bug] [pgsql] watchdog referer, location field length

Thomas Ilsche drupal-devel at drupal.org
Mon Aug 29 14:49:46 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    watchdog.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Thomas Ilsche
 Updated by:   Thomas Ilsche
 Status:       patch (code needs review)

"About field length - don't know what's right approach

Is there ANY reason to use VARCHAR(128)?

MySQL stores them always using one length byte plus the actual string,
resulting in a maximum VARCHAR(255), there is no reason to use a lower

pgSQL afaik always uses four length bytes with a physical limit of 1
GB, If I am not mistake text / VARCHAR without any length specifier
could be used without any disadvantages. So why not use that? I think
thats more easy and comfortable than truncating the string.

Thomas Ilsche

Previous comments:

Sat, 27 Aug 2005 17:40:30 +0000 : Thomas Ilsche

It is quite easy to exceed the the watchdog referer and location field
length of 128.

The problem especielly with pgsql is that it generates an error, not
just truncate the content like MySQL does.

1. For all databases I would suggest changing the limit to 255 (which
is, at least for MySQL, the real limit).
2. More imporant: Add substrs to watchdog().

I would make a patch for the second but I fear I lack knowledge of
update_***() for the first.


Mon, 29 Aug 2005 14:29:05 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/drupal-head-referer-29814.diff (1.07 KB)

This patch cuts referer to 128 characters before inserting into db, not
About field length - don't know what's right approach.

More information about the drupal-devel mailing list