| 1 |
# |
| 2 |
# Test that SET DEFAULT ROLE doesn't work on old privilege tables |
| 3 |
# that don't have 'default_role' column |
| 4 |
# |
| 5 |
source include/not_embedded.inc; |
| 6 |
source include/switch_to_mysql_user.inc; |
| 7 |
|
| 8 |
connect (mysql, localhost, root,,); |
| 9 |
use mysql; |
| 10 |
|
| 11 |
# |
| 12 |
# downgrade the table to pre-default-role structure |
| 13 |
# |
| 14 |
alter table user drop column is_role; |
| 15 |
alter table user drop column default_role; |
| 16 |
alter table user drop column max_statement_time; |
| 17 |
|
| 18 |
flush privileges; |
| 19 |
|
| 20 |
--replace_regex /11\d\d\d\d/MYSQL_VERSION_ID/ |
| 21 |
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE |
| 22 |
create role test_role; |
| 23 |
--error ER_CANNOT_USER |
| 24 |
drop role test_role; |
| 25 |
alter table user add column is_role enum('N', 'Y') default 'N' not null |
| 26 |
COLLATE utf8_general_ci |
| 27 |
after password_expired; |
| 28 |
|
| 29 |
# Test default role column |
| 30 |
create role test_role; |
| 31 |
create user test_user@localhost; |
| 32 |
grant test_role to test_user@localhost; |
| 33 |
set default role test_role for root@localhost; |
| 34 |
drop role test_role; |
| 35 |
drop user test_user@localhost; |
| 36 |
|
| 37 |
alter table user add column default_role char(80) default '' not null |
| 38 |
COLLATE utf8_general_ci |
| 39 |
after is_role; |
| 40 |
alter table user add max_statement_time decimal(12,6) default 0 not null |
| 41 |
after default_role; |
| 42 |
|
| 43 |
update user set is_role='N'; |
| 44 |
|
| 45 |
flush privileges; |
| 46 |
create role test_role; |
| 47 |
drop role test_role; |
| 48 |
|
| 49 |
source include/switch_to_mysql_global_priv.inc; |