| 1 |
include/save_binlog_position.inc |
| 2 |
# ---------------------------------------------------------------------- |
| 3 |
# Begin : Tests for CREATE ROLE |
| 4 |
CREATE USER userX; |
| 5 |
CREATE ROLE roleX; |
| 6 |
include/save_binlog_position.inc |
| 7 |
# Case 1 : Execute CREATE ROLE for existing users |
| 8 |
CREATE ROLE userZ, roleZ, userX, roleX; |
| 9 |
ERROR HY000: Operation CREATE ROLE failed for 'userX'@'%','roleX'@'%' |
| 10 |
# Must not show entries for userZ and roleZ |
| 11 |
SELECT user FROM mysql.user WHERE user LIKE 'user%'; |
| 12 |
user |
| 13 |
userX |
| 14 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 15 |
user |
| 16 |
roleX |
| 17 |
# This event sequence pattern MUST NOT be present in binlog: !Q(CREATE ROLE.*userZ.*roleZ.*userX.*roleX.*) |
| 18 |
include/assert_binlog_events.inc |
| 19 |
include/save_binlog_position.inc |
| 20 |
# Case 2 : Execute CREATE ROLE for non-existing users |
| 21 |
CREATE ROLE roleZ, roleA; |
| 22 |
# Must show entry for roleZ, roleA |
| 23 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 24 |
user |
| 25 |
roleA |
| 26 |
roleX |
| 27 |
roleZ |
| 28 |
# This event sequence pattern MUST be present in binlog: !Q(CREATE ROLE.*roleZ.*roleA.*) |
| 29 |
include/assert_binlog_events.inc |
| 30 |
DROP USER userX; |
| 31 |
DROP ROLE roleX, roleZ, roleA; |
| 32 |
include/save_binlog_position.inc |
| 33 |
# End : Tests for CREATE ROLE |
| 34 |
# ---------------------------------------------------------------------- |
| 35 |
# Begin : Tests for CREATE ROLE IF NOT EXISTS |
| 36 |
CREATE ROLE roleX; |
| 37 |
include/save_binlog_position.inc |
| 38 |
# Case 1 : Execute CREATE ROLE IF NOT EXISTS for exising and non-existing users |
| 39 |
CREATE ROLE IF NOT EXISTS roleX, roleY, roleZ; |
| 40 |
Warnings: |
| 41 |
Note 3163 Authorization ID 'roleX'@'%' already exists. |
| 42 |
# Must show entry for roleY and roleZ |
| 43 |
SELECT user FROM mysql.user WHERE user LIKE 'role%'; |
| 44 |
user |
| 45 |
roleX |
| 46 |
roleY |
| 47 |
roleZ |
| 48 |
# This event sequence pattern MUST be present in binlog: !Q(CREATE ROLE IF NOT EXISTS.*roleX.*roleY.*roleZ.*) |
| 49 |
include/assert_binlog_events.inc |
| 50 |
include/save_binlog_position.inc |
| 51 |
# case 2 : Execute CREATE ROLE IF NOT EXISTS for existing users |
| 52 |
CREATE ROLE IF NOT EXISTS roleX, roleY, roleZ; |
| 53 |
Warnings: |
| 54 |
Note 3163 Authorization ID 'roleX'@'%' already exists. |
| 55 |
Note 3163 Authorization ID 'roleY'@'%' already exists. |
| 56 |
Note 3163 Authorization ID 'roleZ'@'%' already exists. |
| 57 |
# This event sequence pattern MUST be present in binlog: !Q(CREATE ROLE IF NOT EXISTS.*roleX.*roleY.*roleZ.*) |
| 58 |
include/assert_binlog_events.inc |
| 59 |
DROP ROLE roleX, roleY, roleZ; |
| 60 |
include/save_binlog_position.inc |
| 61 |
# End : Tests for CREATE ROLE IF NOT EXISTS |
| 62 |
# ---------------------------------------------------------------------- |