[drupal-devel] [bug] Field location in table locales_source is too short

patryk drupal-devel at drupal.org
Tue May 3 14:30:28 UTC 2005

Issue status update for http://drupal.org/node/21252

 Project:      Drupal
 Version:      4.6.0
 Component:    database system
 Category:     bug reports
 Priority:     critical
 Assigned to:  patryk
 Reported by:  patryk
 Updated by:   patryk
 Status:       patch
 Attachment:   http://drupal.org/files/issues/drupal-4-6-locales-fix.diff (1.21 KB)

baudolino has provided the patch for HEAD's update.inc, I'm providing
the same for DRUPAL-4-6's. Hope it is the last patch for this task :)


Previous comments:

April 25, 2005 - 03:45 : patryk

Attachment: http://drupal.org/files/issues/drupal-cvs-pgsql-locales_field_type-fix.diff (317 bytes)

Field "location" in table "locales_source" is too short. The patch makes
it limitless.


April 25, 2005 - 19:55 : Dries

There is a similar location-row in the watchdog table.

The MySQL database scheme also uses varchar(128) so it is not specific
to PostgreSQL.

I wouldn't recommend making it limitless.  Maybe 255 is more sensible?


April 28, 2005 - 22:44 : patryk

Attachment: http://drupal.org/files/issues/drupal-cvs-pgsql-locales_field_type_v2-fix.diff (686 bytes)

Hmm... maybe you're right. I came accross a polish language pack which
had 177 characters in that field, it could easily have more, but I
think 256 will be good for now.

The field in watchdog is not revelant to this bug as it handles the
filename of event occured and can contain only one location, unlike
many as here.

The new patch attached and bug details changed.


May 1, 2005 - 18:06 : Dries

Committed to HEAD and DRUPAL-4-6.  Thanks patryk.


May 2, 2005 - 17:43 : jhriggs

The field was changed to 256 by this patch.  Not sure about pgsql, but
the max for a CHAR/VARCHAR in mysql is 255.  Patch attached.

Note:  Shouldn't there also be a update in updates.inc for this since
it is a schema change?


May 2, 2005 - 17:46 : jhriggs

I didn't realize the patch had been applied to 4.6 also.  Marking as


May 2, 2005 - 22:02 : patryk

Attachment: http://drupal.org/files/issues/drupal-cvs-locales-fix.diff (1.83 KB)

I made a small investigation. Postgres eats 1 GB strings for breakfast
unlike MySQL which sucks with it's 255 character limit until 5.0.3
excluding ;) (even 5.0.3 has limit of 65536 chars)

Some references:
- as Drupal must use v7.4 at least

In the result let's do that field 255 chars long in both databases to
be coherent.

PS: I'm thinking about something to ease pgsql 7.4's column type
change. 8.0 has it already implemented. Maybe some hyper-clever
function? ;)

The new patch against today's CVS attached. Includes updates in


May 3, 2005 - 01:31 : drumm

+1 for the database.mysql part which I sucessfully used. That file in
the 4.6 branch is rather broken.


May 3, 2005 - 07:20 : Dries

Committed to HEAD.  The update.inc-part did not apply against HEAD
though.  Marking this active.


May 3, 2005 - 08:24 : baudolino

Attachment: http://drupal.org/files/issues/update_135.patch.diff (1.38 KB)

This should patch update.inc

More information about the drupal-devel mailing list