summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/grant.result3
-rw-r--r--mysql-test/t/grant.test5
-rw-r--r--sql/sql_acl.cc8
3 files changed, 5 insertions, 11 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index b6803a49c76..2f417a41652 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -943,8 +943,9 @@ DROP TABLE mysqltest3.t_nn;
DROP DATABASE mysqltest3;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost';
+use test;
create user mysqltest1_thisisreallytoolong;
-ERROR HY000: Operation CREATE USER failed for 'mysqltest1_thisisreallytoolong'@'%'
+ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
GRANT CREATE ON mysqltest.* TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 0f63bc300d0..a938a8a64a7 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -805,12 +805,13 @@ DROP DATABASE mysqltest3;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost';
-
+# eestore the original database
+use test;
#
# Bug #10668: CREATE USER does not enforce username length limit
#
---error ER_CANNOT_USER
+--error ER_WRONG_STRING_LENGTH
create user mysqltest1_thisisreallytoolong;
#
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 6f2b464ef08..cb0a9576378 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5232,14 +5232,6 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
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
for a mention of the new user name.