The Postgresql database script shipped with Drupal 4.5.2 has a 32 characters long varchar value for role name. The relevant UI form field, however, has attribute maxlength="64". This naturally causes an SQL error, if too long name is entered.

The SQL part is still same in CVS version, but I don't know if the UI part has been fixed.

Related SQL:

CREATE TABLE role (
rid SERIAL,
name varchar(32) NOT NULL default '',
PRIMARY KEY (rid),
UNIQUE (name)
);

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plj’s picture

Title: UI allows longer role name than database.pgsql » UI allows longer role name than database
Version: » 4.6.1
Component: user system » database system

Changing version to 4.6.1, and component to database system (perhaps more relevant than user system), as the problem still exists. It also seems that the length of the field in question is only 32 in both database.mysql and database.pgsql, even though the UI allows 64.

Either UI or the database scripts should be fixed.

plj’s picture

FileSize
660 bytes

On a second thought, here is a patch against both DBs. Both are untested, but the change is tiny.

Cvbge’s picture

Version: 4.6.1 » 4.6.2
Status: Needs review » Needs work

There should be also a patch for database/updates.inc

plj’s picture

Version: 4.6.2 » 4.6.3

I've no idea how the update.inc's update numbering works. But it should excecute a statement like this:

alter table role alter column name type varchar(64)
Cvbge’s picture

FileSize
2.61 KB

I have not tested mysql's update, but I think it should work.

Cvbge’s picture

Status: Needs work » Needs review
killes@www.drop.org’s picture

Version: 4.6.3 »
Status: Needs review » Needs work

Should be applied against head, but does not apply.

kkaefer’s picture

Status: Needs work » Needs review
FileSize
2.11 KB

As this patch has not yet been committed, I made a new patch against head.

Crell’s picture

Status: Needs review » Needs work

Patch no longer applies cleanly for updates.inc. There were also some CR errors. I think it is useful and important, though.

ChrisKennedy’s picture

Version: » 5.x-dev
Status: Needs work » Needs review
FileSize
1.54 KB

Confirmed that this is still an issue. Re-rolled against cvs and updated for the new .install system.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)