Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal-head-referer-29814.diff | 1.07 KB | Cvbge |
Comments
Comment #1
Cvbge CreditAttribution: Cvbge commentedThis patch cuts referer to 128 characters before inserting into db, not tested.
About field length - don't know what's right approach.
Comment #2
Thomas Ilsche CreditAttribution: Thomas Ilsche commentedIs 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 n?
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.
Comment #3
bl4h CreditAttribution: bl4h commentedis it ok to set varchar 255? Im worried theres a good reason for not having it set that way.
This bug is extremely annoying!!!! Especially if you have php display warnings on
Comment #4
Cvbge CreditAttribution: Cvbge commentedI believe this was fixed in cvs version. All columns in watchdog table except for type and hostname columns (which contain limited data and don't need to be changed) are "text" type now.
Comment #5
(not verified) CreditAttribution: commented