Re:McGill will double your password if you don’t do it first
by reberhardt on Tuesday November 18, 2014 @11:48PM
(#8628337)
In addition to the frontend issue mod mentioned, it often happens accidentally without any errors or warnings when using a VARCHAR in a relational database, which have a maximum length. If the username field is VARCHAR(20), the application ignores database truncation warnings, and the developer didn't think to check the username length before storing it in the database, it'll truncate a 21-character username without you knowing. This comes down to the devs using sensible field lengths and handling edge cases.
Re:McGill will double your password if you don’t do it first
by desas on Wednesday November 19, 2014 @04:03AM
(#8628974)
I think mysql is the only database that auto truncates varchars isn't it?
Re:McGill will double your password if you don’t do it first
by MichaelGG on Wednesday November 19, 2014 @03:13AM
(#8628830)
Well, you have to have some limit. Otherwise a user could register with a 1GB username. This might break all sorts of things that assume they can display or work with usernames.
Re:McGill will double your password if you don’t do it first
by mike-cardwell on Wednesday November 19, 2014 @08:11AM
(#8629764)
This is why you prevent them from entering one that is longer than your limit. You don't let them enter it and then truncate it...
Re:McGill will double your password if you don’t do it first
by mod on Tuesday November 18, 2014 @11:15PM
(#8628224)
To keep username from ruining the front-end.
If I had a 2,000 character username, this page would look really stupid.
Re:McGill will double your password if you don’t do it first
by ChrisGranger on Tuesday November 18, 2014 @11:43PM
(#8628322)
I saw an example of that on a JavaScript-related site recently, where a guy's username was aaa...aaa several hundred characters long, causing a ludicrous horizontal scroll bar. You'd think it would be easy enough to say upfront during account creation that both usernames and passwords are limited to x characters.
Re:McGill will double your password if you don’t do it first
by mike-cardwell on Wednesday November 19, 2014 @08:13AM
(#8629775)
That is what this css is for:
overflow: hidden;
text-overflow: ellipsis;
Why on earth would you ever need to truncate a username?