summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant_4332.test
blob: 41e0b822f985de7acd6a2d6f8bb2974e5cb56c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# MDEV-4332 Increase username length from 16 characters
#
# test that when ALTER-ing tables to have short usernames,
# the server switches to short usernames internally too.
#

--source include/not_embedded.inc
set GLOBAL sql_mode="";
set LOCAL sql_mode="";

alter table mysql.user modify User char(16) binary not null default '';
alter table mysql.db modify User char(16) binary not null default '';
alter table mysql.tables_priv modify User char(16) binary not null default '';
alter table mysql.columns_priv modify User char(16) binary not null default '';
alter table mysql.procs_priv modify User char(16) binary not null default '';
alter table mysql.proc modify definer char(77) collate utf8_bin not null default '';
alter table mysql.event modify definer char(77) collate utf8_bin not null default '';
flush privileges;

--enable_metadata
select user();
--disable_metadata

--error ER_WRONG_STRING_LENGTH
create user a17aaaaaaaaaaaaa0@localhost;
--error ER_WRONG_STRING_LENGTH
grant usage on *.* to a17aaaaaaaaaaaaa0@lodalhost;
--error ER_WRONG_STRING_LENGTH
drop user a17aaaaaaaaaaaaa0@lodalhost;

alter table mysql.user modify User char(80) binary not null default '';
alter table mysql.db modify User char(80) binary not null default '';
alter table mysql.tables_priv modify User char(80) binary not null default '';
alter table mysql.columns_priv modify User char(80) binary not null default '';
alter table mysql.procs_priv modify User char(80) binary not null default '';
alter table mysql.proc modify definer char(141) collate utf8_bin not null default '';
alter table mysql.event modify definer char(141) collate utf8_bin not null default '';
flush privileges;

--enable_metadata
select user();
--disable_metadata

set GLOBAL sql_mode=default;