View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008017mantisbtadministrationpublic2007-05-25 03:552014-09-04 04:53
Assigned Todregad 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target Version1.3.xFixed in Version1.3.x 
Summary0008017: Increase the size of the username field
DescriptionThe username field in mantis is limited to 32 characters in the database and in the corresponding text boxes. This makes difficult for administrators who uses email as the username for mantis. In my case, I am using ldap uids which are of the form firstname.lastname@domain.tld, which generally has more than 50 characters. It would be nice if the username field size is increased to 64 characters(VARCHAR).
Additional InformationThese are the list of changes to be done to attain the above feature.
Database modification:
mysql> alter table mantis_user_table change username username varchar(64);

Source code changes(filenames)

Attached Filespatch file icon username_field-1.1.6.patch [^] (2,628 bytes) 2009-01-12 04:52 [Show Content]
patch file icon username-trunk.patch [^] (1,153 bytes) 2009-01-13 02:32 [Show Content]

- Relationships
has duplicate 0013478closedatrol max username size (32 char) is too small 
has duplicate 0008596closedatrol Unable to log in using username with more than 32 characters 

-  Notes
User avatar (0014736)
vboctor (administrator)
2007-06-09 13:09

The size of the field in the database also needs to be changed. If we are going to increase the field size, then we should increase it to the maximum size of an email address as per RFC or the maximum size allowed for a db varchar field. So, I would suggest 250.
User avatar (0014826)
libregeek (reporter)
2007-06-27 08:04

RFC 2821 ( [^]) specifies that the local part of the email address can ne upto 64 characters and the domain part upto 255 characters. Combining these two will make up 319characters which may not be necessary in the near future.
So I would also suggest to use the maximum allowed size of a database VARCHAR field. I think that the maximum allowed sixe(in MySQL) is 255, am I right?
User avatar (0020586)
libregeek (reporter)
2009-01-12 04:51

I have created a patch for increasing the size of username field in mantis-1.1.6. Please verify and commit if it makes sense. This patch will increase the size of the username field to 255 characters.
User avatar (0020594)
siebrand (developer)
2009-01-12 18:06

Please update patch to be based on trunk.
User avatar (0020598)
libregeek (reporter)
2009-01-13 01:34

I'm confused on how to get the source code from the git repository. It seems the documentation in [^] doesn't have enough information about git. Please help.
User avatar (0020599)
siebrand (developer)
2009-01-13 01:53

Yeah, I was a bit confused, too. Still learning GIT and I have access to the master repo, so didn't know about the public repo. See [^] for details.
User avatar (0020600)
libregeek (reporter)
2009-01-13 02:31

Here is a quick patch from trunk. I'm a beginner in GIT, please guide me if something have gone wrong.
User avatar (0030152)
ubuone (reporter)
2011-11-03 05:59

Hi, to increase the username max size on an existing installation of mantis, you just have to increase the username database field to 255 (for example) and to create a custom_constants_inc.php file with :
<?php define( 'DB_FIELD_SIZE_USERNAME', 255);
The rest is cosmetic (html input size).
Am I right ?
User avatar (0031037)
anabuki (reporter)
2012-01-25 17:44

I am running Mantis version 1.2.8, and, as far as I have been able to perceive, the changes on the files described here are not required anymore. The files have already been updated to use a constant.

To change the size of the login field, you just need to edit the column "username" in the table "bugtracker.mantis_user_table" to the required size and then, change the constant "DB_FIELD_SIZE_USERNAME" in the file "core/constant_inc.php".

In my case, I changed the column to varchar(64) and changed the constant size to 64. And now I can create longer usernames. =)

Ps.: Just adding this comment, so that people may know how to change the username size in the new versions of Mantis.
User avatar (0031060)
vboctor (administrator)
2012-01-27 12:39

The change to the schema file is incorrect. What you should do is add a step to the end of the schema that change the size of the username field. This way, the upgrade path works as well, and not just the new installs. In other words, the schema file should create the username with the old size, then make it larger at the end.

I would also suggest that you try using to fork the code, apply your change, and then submit a pull request. This will make the process as efficient as possible.
User avatar (0031126)
grangeway (reporter)
2012-02-05 07:31

fixed in next branch
User avatar (0031165)
libregeek (reporter)
2012-02-06 00:02

Could you please post the changeset id?
User avatar (0031467)
atrol (developer)
2012-03-14 18:26

Reopened, there is no "Fixed in Version" and we will have no "Roadmap" and
"Changelog". There is no patch / changeset attached which will confuse any user
who has a look at this issue.
User avatar (0031685)
ubuone (reporter)
2012-04-18 10:46

In mantisbt 1.2.9 the size of the column "username" is 255.
But the max length of the field in the html form is limited to 32 char.
This lentgh can be modified with the constant "DB_FIELD_SIZE_USERNAME" in the file "core/constant_inc.php".
Is it possible to define this size in a user file like custom_constants_inc.php ?
User avatar (0031686)
atrol (developer)
2012-04-18 10:57

ubuone wrote
> In mantisbt 1.2.9 the size of the column "username" is 255.

This is not true, it's still 32.
User avatar (0031699)
ubuone (reporter)
2012-04-20 16:38

Sorry, my mistake !
User avatar (0040621)
ubuone (reporter)
2014-05-22 08:35

in mantisbt 1.3.0dev username size is still 32, could it be increased to 255 ?
User avatar (0040933)
dregad (developer)
2014-07-17 03:35 [^]

- Related Changesets
MantisBT: master d103c028
Timestamp: 2014-05-22 12:36:24
Author: dregad
Committer: Paul Richards
Details ] Diff ]
Fix 0008017: allow username up to 255 chars

Signed-off-by: Paul Richards <>
mod - admin/schema.php Diff ] File ]
mod - core/constant_inc.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2007-05-25 03:55 libregeek New Issue
2007-06-09 13:09 vboctor Note Added: 0014736
2007-06-09 13:09 vboctor Status new => confirmed
2007-06-27 08:04 libregeek Note Added: 0014826
2009-01-12 04:51 libregeek Note Added: 0020586
2009-01-12 04:52 libregeek File Added: username_field-1.1.6.patch
2009-01-12 18:06 siebrand Note Added: 0020594
2009-01-12 18:06 siebrand Status confirmed => feedback
2009-01-12 18:39 siebrand Tag Attached: patch
2009-01-13 01:34 libregeek Note Added: 0020598
2009-01-13 01:53 siebrand Note Added: 0020599
2009-01-13 02:31 libregeek Note Added: 0020600
2009-01-13 02:32 libregeek File Added: username-trunk.patch
2011-11-02 14:01 atrol Relationship added has duplicate 0013478
2011-11-03 05:59 ubuone Note Added: 0030152
2012-01-25 17:44 anabuki Note Added: 0031037
2012-01-27 12:39 vboctor Note Added: 0031060
2012-02-05 07:31 grangeway Note Added: 0031126
2012-02-05 07:31 grangeway Status feedback => resolved
2012-02-05 07:31 grangeway Resolution open => fixed
2012-02-05 07:31 grangeway Assigned To => grangeway
2012-02-06 00:02 libregeek Note Added: 0031165
2012-02-20 07:18 atrol Status resolved => closed
2012-03-14 18:26 atrol Note Added: 0031467
2012-03-14 18:26 atrol Status closed => feedback
2012-03-14 18:26 atrol Resolution fixed => reopened
2012-04-18 10:46 ubuone Note Added: 0031685
2012-04-18 10:57 atrol Note Added: 0031686
2012-04-20 16:38 ubuone Note Added: 0031699
2012-10-12 18:40 atrol Relationship added has duplicate 0008596
2014-05-22 08:35 ubuone Note Added: 0040621
2014-05-23 19:25 grangeway Status feedback => assigned
2014-07-17 03:35 dregad Assigned To grangeway => dregad
2014-07-17 03:35 dregad Note Added: 0040933
2014-07-17 03:35 dregad Target Version => 1.3.x
2014-09-01 17:35 dregad Changeset attached => MantisBT master d103c028
2014-09-01 17:35 dregad Status assigned => resolved
2014-09-01 17:35 dregad Fixed in Version => 1.3.x
2014-09-01 17:44 atrol Resolution reopened => fixed

MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.1224 seconds.
memory usage: 3,165 KB
Powered by Mantis Bugtracker