| 1 |
--source include/have_log_bin.inc |
| 2 |
--source include/save_binlog_position.inc |
| 3 |
|
| 4 |
# Save the initial number of concurrent sessions |
| 5 |
--source include/count_sessions.inc |
| 6 |
|
| 7 |
--echo # ---------------------------------------------------------------------- |
| 8 |
|
| 9 |
--echo # Begin : Tests for DROP ROLE |
| 10 |
|
| 11 |
CREATE ROLE roleX, roleY, roleZ; |
| 12 |
--source include/save_binlog_position.inc |
| 13 |
|
| 14 |
--echo # Case 1 : Execute DROP ROLE for existing users |
| 15 |
|
| 16 |
DROP ROLE roleX, roleY; |
| 17 |
|
| 18 |
--echo # Must show roleZ |
| 19 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 20 |
|
| 21 |
--let $event= !Q(DROP ROLE.*roleX.*roleY.*) |
| 22 |
--source ../include/auth_sec_assert_binlog_events.inc |
| 23 |
--source include/save_binlog_position.inc |
| 24 |
|
| 25 |
--echo # Case 2 : Execute DROP ROLE for non-existing users |
| 26 |
|
| 27 |
--error ER_CANNOT_USER |
| 28 |
DROP ROLE roleZ, roleX; |
| 29 |
|
| 30 |
--echo # Must show entry for roleZ |
| 31 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 32 |
|
| 33 |
--let $invert= 1 |
| 34 |
--let $event= !Q(DROP ROLE.*roleZ.*roleX.*) |
| 35 |
--source ../include/auth_sec_assert_binlog_events.inc |
| 36 |
--let $invert= 0 |
| 37 |
|
| 38 |
DROP ROLE roleZ; |
| 39 |
--source include/save_binlog_position.inc |
| 40 |
|
| 41 |
--echo # End : Tests for DROP ROLE |
| 42 |
|
| 43 |
--echo # ---------------------------------------------------------------------- |
| 44 |
|
| 45 |
--echo # Begin : Tests for DROP ROLE IF EXISTS |
| 46 |
|
| 47 |
CREATE ROLE roleX, roleY, roleZ; |
| 48 |
--source include/save_binlog_position.inc |
| 49 |
|
| 50 |
--echo # Case 1 : Execute DROP ROLE IF NOT EXISTS |
| 51 |
|
| 52 |
DROP ROLE IF EXISTS roleX, roleY, roleZ; |
| 53 |
|
| 54 |
--echo # Must not show entries for roleX, roleY, roleZ |
| 55 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 56 |
|
| 57 |
--let $event= !Q(DROP ROLE IF EXISTS.*roleX.*roleY.*roleZ.*) |
| 58 |
--source ../include/auth_sec_assert_binlog_events.inc |
| 59 |
--source include/save_binlog_position.inc |
| 60 |
|
| 61 |
--echo # case 2 : Execute DROP ROLE IF NOT EXISTS for non-existing users |
| 62 |
|
| 63 |
DROP ROLE IF EXISTS roleX, roleY, roleZ; |
| 64 |
|
| 65 |
--let $event= !Q(DROP ROLE IF EXISTS.*roleX.*roleY.*roleZ.*) |
| 66 |
--source ../include/auth_sec_assert_binlog_events.inc |
| 67 |
|
| 68 |
--source include/save_binlog_position.inc |
| 69 |
--echo # End : Tests for DROP ROLE IF EXISTS |
| 70 |
|
| 71 |
--echo # ---------------------------------------------------------------------- |
| 72 |
|
| 73 |
# Wait till we reached the initial number of concurrent sessions |
| 74 |
--source include/wait_until_count_sessions.inc |