1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Create 'main' test directory and move 't' and 'r' there

This commit is contained in:
Michael Widenius
2018-03-09 14:05:35 +02:00
committed by Monty
parent ab1941266c
commit a7abddeffa
2114 changed files with 75 additions and 77 deletions

View File

@ -0,0 +1,56 @@
--source include/not_embedded.inc
CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user1;
SELECT * FROM mysql.roles_mapping;
DROP ROLE role1;
CREATE OR REPLACE ROLE role1 WITH ADMIN user2;
SELECT * FROM mysql.roles_mapping WHERE Role='role1';
CREATE OR REPLACE ROLE role1 WITH ADMIN user3;
SELECT * FROM mysql.roles_mapping WHERE Role='role1';
CREATE ROLE IF NOT EXISTS role1 WITH ADMIN user4;
SELECT * FROM mysql.roles_mapping WHERE Role='role1';
DROP ROLE IF EXISTS role1;
SELECT * FROM mysql.roles_mapping WHERE Role='role1';
DROP ROLE IF EXISTS role1;
CREATE ROLE role_1;
CREATE ROLE IF NOT EXISTS role_1;
CREATE OR REPLACE ROLE role_1;
--error ER_WRONG_USAGE
CREATE OR REPLACE ROLE IF NOT EXISTS role_1;
--error ER_CANNOT_USER
CREATE ROLE role_1;
CREATE USER u1@localhost;
REVOKE SHOW DATABASES ON *.* FROM 'u1'@'localhost';
GRANT SHOW DATABASES ON *.* TO role_1;
GRANT role_1 TO u1@localhost;
connect (user_a, localhost, u1,,);
connection user_a;
SELECT CURRENT_USER;
SHOW DATABASES;
SELECT CURRENT_ROLE;
SET ROLE role_1;
SELECT CURRENT_ROLE;
SHOW DATABASES;
SET ROLE NONE;
connect (user_b, localhost, root,,);
connection user_b;
--echo # Clearing up
DROP ROLE role_1;
DROP ROLE IF EXISTS role_1;
--error ER_CANNOT_USER
DROP ROLE role_1;
DROP USER u1@localhost;