-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix debian patch * update the copyright * rename include guards to follow conventions * restore incorectly deleted test file, add clarification in a comment * capitalize the first letter of the status variable
- Loading branch information
Showing
7 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use mysql; | ||
alter table user drop column is_role; | ||
alter table user drop column default_role; | ||
alter table user drop column max_statement_time; | ||
flush privileges; | ||
create role test_role; | ||
ERROR HY000: Column count of mysql.user is wrong. Expected 44, found 43. Created with MariaDB MYSQL_VERSION_ID, now running MYSQL_VERSION_ID. Please use mysql_upgrade to fix this error. | ||
drop role test_role; | ||
ERROR HY000: Operation DROP ROLE failed for 'test_role' | ||
alter table user add column is_role enum('N', 'Y') default 'N' not null | ||
COLLATE utf8_general_ci | ||
after password_expired; | ||
create role test_role; | ||
create user test_user@localhost; | ||
grant test_role to test_user@localhost; | ||
set default role test_role for root@localhost; | ||
ERROR HY000: Column count of mysql.user is wrong. Expected 45, found 44. Created with MariaDB MYSQL_VERSION_ID, now running MYSQL_VERSION_ID. Please use mysql_upgrade to fix this error. | ||
drop role test_role; | ||
drop user test_user@localhost; | ||
alter table user add column default_role char(80) binary default '' not null | ||
COLLATE utf8_general_ci | ||
after is_role; | ||
alter table user add max_statement_time decimal(12,6) default 0 not null | ||
after default_role; | ||
update user set is_role='N'; | ||
flush privileges; | ||
create role test_role; | ||
drop role test_role; |
48 changes: 48 additions & 0 deletions
48
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# Test that SET DEFAULT ROLE doesn't work on old privilege tables | ||
# that don't have 'default_role' column | ||
# | ||
source include/not_embedded.inc; | ||
|
||
connect (mysql, localhost, root,,); | ||
use mysql; | ||
|
||
# | ||
# downgrade the table to pre-default-role structure | ||
# | ||
alter table user drop column is_role; | ||
alter table user drop column default_role; | ||
alter table user drop column max_statement_time; | ||
|
||
flush privileges; | ||
|
||
--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/ | ||
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE | ||
create role test_role; | ||
--error ER_CANNOT_USER | ||
drop role test_role; | ||
alter table user add column is_role enum('N', 'Y') default 'N' not null | ||
COLLATE utf8_general_ci | ||
after password_expired; | ||
|
||
# Test default role column | ||
create role test_role; | ||
create user test_user@localhost; | ||
grant test_role to test_user@localhost; | ||
--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/ | ||
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE | ||
set default role test_role for root@localhost; | ||
drop role test_role; | ||
drop user test_user@localhost; | ||
|
||
alter table user add column default_role char(80) binary default '' not null | ||
COLLATE utf8_general_ci | ||
after is_role; | ||
alter table user add max_statement_time decimal(12,6) default 0 not null | ||
after default_role; | ||
|
||
update user set is_role='N'; | ||
|
||
flush privileges; | ||
create role test_role; | ||
drop role test_role; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters