| 1 |
# |
| 2 |
# MDEV-21971 Bind BINLOG ADMIN to binlog_annotate_row_events and binlog_row_image global and session variables |
| 3 |
# |
| 4 |
SET @global=@@global.binlog_annotate_row_events; |
| 5 |
# Test that "SET binlog_annotate_row_events" is not allowed without BINLOG ADMIN |
| 6 |
CREATE USER user1@localhost; |
| 7 |
GRANT ALL PRIVILEGES ON *.* TO user1@localhost; |
| 8 |
REVOKE BINLOG ADMIN ON *.* FROM user1@localhost; |
| 9 |
connect user1,localhost,user1,,; |
| 10 |
connection user1; |
| 11 |
SET GLOBAL binlog_annotate_row_events=1; |
| 12 |
ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation |
| 13 |
SET binlog_annotate_row_events=1; |
| 14 |
ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation |
| 15 |
SET SESSION binlog_annotate_row_events=1; |
| 16 |
ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation |
| 17 |
disconnect user1; |
| 18 |
connection default; |
| 19 |
DROP USER user1@localhost; |
| 20 |
# Test that "SET binlog_annotate_row_events" is allowed with BINLOG ADMIN |
| 21 |
CREATE USER user1@localhost; |
| 22 |
GRANT BINLOG ADMIN ON *.* TO user1@localhost; |
| 23 |
connect user1,localhost,user1,,; |
| 24 |
connection user1; |
| 25 |
SET GLOBAL binlog_annotate_row_events=1; |
| 26 |
SET binlog_annotate_row_events=1; |
| 27 |
SET SESSION binlog_annotate_row_events=1; |
| 28 |
disconnect user1; |
| 29 |
connection default; |
| 30 |
DROP USER user1@localhost; |
| 31 |
SET @@global.binlog_annotate_row_events=@global; |