75 lines
2.1 KiB
Plaintext
75 lines
2.1 KiB
Plaintext
--source include/have_log_bin.inc
|
|
--source include/save_binlog_position.inc
|
|
|
|
# Save the initial number of concurrent sessions
|
|
--source include/count_sessions.inc
|
|
|
|
--echo # ----------------------------------------------------------------------
|
|
|
|
--echo # Begin : Tests for DROP ROLE
|
|
|
|
CREATE ROLE roleX, roleY, roleZ;
|
|
--source include/save_binlog_position.inc
|
|
|
|
--echo # Case 1 : Execute DROP ROLE for existing users
|
|
|
|
DROP ROLE roleX, roleY;
|
|
|
|
--echo # Must show roleZ
|
|
SELECT user FROM mysql.user WHERE user LIKE 'role%';
|
|
|
|
--let $event= !Q(DROP ROLE.*roleX.*roleY.*)
|
|
--source ../include/auth_sec_assert_binlog_events.inc
|
|
--source include/save_binlog_position.inc
|
|
|
|
--echo # Case 2 : Execute DROP ROLE for non-existing users
|
|
|
|
--error ER_CANNOT_USER
|
|
DROP ROLE roleZ, roleX;
|
|
|
|
--echo # Must show entry for roleZ
|
|
SELECT user FROM mysql.user WHERE user LIKE 'role%';
|
|
|
|
--let $invert= 1
|
|
--let $event= !Q(DROP ROLE.*roleZ.*roleX.*)
|
|
--source ../include/auth_sec_assert_binlog_events.inc
|
|
--let $invert= 0
|
|
|
|
DROP ROLE roleZ;
|
|
--source include/save_binlog_position.inc
|
|
|
|
--echo # End : Tests for DROP ROLE
|
|
|
|
--echo # ----------------------------------------------------------------------
|
|
|
|
--echo # Begin : Tests for DROP ROLE IF EXISTS
|
|
|
|
CREATE ROLE roleX, roleY, roleZ;
|
|
--source include/save_binlog_position.inc
|
|
|
|
--echo # Case 1 : Execute DROP ROLE IF NOT EXISTS
|
|
|
|
DROP ROLE IF EXISTS roleX, roleY, roleZ;
|
|
|
|
--echo # Must not show entries for roleX, roleY, roleZ
|
|
SELECT user FROM mysql.user WHERE user LIKE 'role%';
|
|
|
|
--let $event= !Q(DROP ROLE IF EXISTS.*roleX.*roleY.*roleZ.*)
|
|
--source ../include/auth_sec_assert_binlog_events.inc
|
|
--source include/save_binlog_position.inc
|
|
|
|
--echo # case 2 : Execute DROP ROLE IF NOT EXISTS for non-existing users
|
|
|
|
DROP ROLE IF EXISTS roleX, roleY, roleZ;
|
|
|
|
--let $event= !Q(DROP ROLE IF EXISTS.*roleX.*roleY.*roleZ.*)
|
|
--source ../include/auth_sec_assert_binlog_events.inc
|
|
|
|
--source include/save_binlog_position.inc
|
|
--echo # End : Tests for DROP ROLE IF EXISTS
|
|
|
|
--echo # ----------------------------------------------------------------------
|
|
|
|
# Wait till we reached the initial number of concurrent sessions
|
|
--source include/wait_until_count_sessions.inc
|