| 1 |
include/save_binlog_position.inc |
| 2 |
# ---------------------------------------------------------------------- |
| 3 |
# Begin : Tests for GRANT ROLE |
| 4 |
CREATE USER userX, userY, userZ; |
| 5 |
CREATE ROLE roleX, roleY, roleZ; |
| 6 |
include/save_binlog_position.inc |
| 7 |
# Case 1 : Execute GRANT ROLE for existing users |
| 8 |
GRANT roleX, roleY TO userX, userY; |
| 9 |
# Must show grants |
| 10 |
SELECT FROM_USER, TO_USER FROM mysql.role_edges; |
| 11 |
FROM_USER TO_USER |
| 12 |
roleX userX |
| 13 |
roleX userY |
| 14 |
roleY userX |
| 15 |
roleY userY |
| 16 |
# This event sequence pattern MUST be present in binlog: !Q(GRANT.*roleX.*roleY.*TO.*userX.*userY.*) |
| 17 |
include/assert_binlog_events.inc |
| 18 |
include/save_binlog_position.inc |
| 19 |
# Case 2 : Execute GRANT ROLE for non-existing users |
| 20 |
GRANT roleZ, roleA TO userX, userY; |
| 21 |
ERROR HY000: Unknown authorization ID `roleA`@`%` |
| 22 |
GRANT roleZ TO userX, userA; |
| 23 |
ERROR HY000: Unknown authorization ID `userA`@`%` |
| 24 |
# Must not have changed |
| 25 |
SELECT FROM_USER, TO_USER FROM mysql.role_edges; |
| 26 |
FROM_USER TO_USER |
| 27 |
roleX userX |
| 28 |
roleX userY |
| 29 |
roleY userX |
| 30 |
roleY userY |
| 31 |
# This event sequence pattern MUST NOT be present in binlog: !Q(GRANT.*roleZ.*roleA.*TO.*userX.*userY.*) |
| 32 |
include/assert_binlog_events.inc |
| 33 |
# This event sequence pattern MUST NOT be present in binlog: !Q(GRANT.*roleZ.*TO.*userX.*userA.*) |
| 34 |
include/assert_binlog_events.inc |
| 35 |
DROP ROLE roleX, roleY, roleZ; |
| 36 |
DROP USER userX, userY, userZ; |
| 37 |
include/save_binlog_position.inc |
| 38 |
# End : Tests for GRANT ROLE |
| 39 |
# ---------------------------------------------------------------------- |