Commit 583675f2 authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge bk-internal:/home/bk/mysql-5.0-maint

into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
parents 620a1792 b876cf57
...@@ -867,3 +867,6 @@ insert into mysql.user select * from t2; ...@@ -867,3 +867,6 @@ insert into mysql.user select * from t2;
flush privileges; flush privileges;
drop table t2; drop table t2;
drop table t1; drop table t1;
create user mysqltest1_thisisreallytoolong;
ERROR HY000: Operation CREATE USER failed for 'mysqltest1_thisisreallytoolong'@'%'
End of 5.0 tests
...@@ -680,4 +680,10 @@ drop table t2; ...@@ -680,4 +680,10 @@ drop table t2;
drop table t1; drop table t1;
#
# Bug #10668: CREATE USER does not enforce username length limit
#
--error ER_CANNOT_USER
create user mysqltest1_thisisreallytoolong;
--echo End of 5.0 tests
...@@ -5220,7 +5220,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) ...@@ -5220,7 +5220,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
{ {
result= TRUE; result= TRUE;
continue; continue;
} }
if (user_name->host.length > HOSTNAME_LENGTH ||
user_name->user.length > USERNAME_LENGTH)
{
append_user(&wrong_users, user_name);
result= TRUE;
continue;
}
/* /*
Search all in-memory structures and grant tables Search all in-memory structures and grant tables
for a mention of the new user name. for a mention of the new user name.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment