File: binlog_rewrite.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (75 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

#
# WL#5706/Bug#58712/Bug#11746378
# Encrypt or remove passwords from slow, query, and binary logs
# (see sql/sql_rewrite.cc for bulk of implementation)
#

-- source include/have_log_bin.inc

RESET MASTER;

#--------------- bin log -------------------------------------------

# misc rewrites.

# Show that when we completely re-synthesize commands,
# we get all the particles right!

CREATE USER user1@localhost IDENTIFIED BY 'secret';
CREATE USER user2@localhost IDENTIFIED BY 'secret';
SET PASSWORD FOR user1@localhost = 'secret';

--echo # Test the password is encrypted in binary log
--echo # with alter user
ALTER USER user1@localhost IDENTIFIED BY 'secret';
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2' /*before with*/WITH/*after with*/MAX_QUERIES_PER_HOUR 90;
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2' /*before require*/REQUIRE SSL/*after require*/ /*before with*/WITH/*after with*/MAX_QUERIES_PER_HOUR 90;
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2';

GRANT UPDATE ON *.* TO user1@localhost WITH GRANT OPTION;
GRANT UPDATE ON *.* /*before to*/TO/*after to*/ user1@localhost;
GRANT UPDATE ON *.* /*before to*/TO/*after to*/ user1@localhost;
GRANT UPDATE ON *.* TO user1@localhost, user2@localhost;
REVOKE UPDATE ON *.* FROM user1@localhost, user2@localhost;

CREATE PROCEDURE p1() SQL SECURITY INVOKER SELECT 1;
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost, user2@localhost;
GRANT EXECUTE ON PROCEDURE p1 /*before to*/TO/*after to*/ user1@localhost, user2@localhost;
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost, user2@localhost;
REVOKE EXECUTE ON PROCEDURE p1 FROM user1@localhost, user2@localhost;

CREATE FUNCTION f1() RETURNS INT RETURN 123;
GRANT EXECUTE ON FUNCTION f1 /*before to*/TO/*after to*/ user1@localhost/*!10000 , user2@localhost*/ /*!99999 THIS_WOULD_BREAK */;
REVOKE EXECUTE ON FUNCTION f1 FROM user1@localhost, user2@localhost;

DROP USER user1@localhost, user2@localhost;
DROP FUNCTION f1;
DROP PROCEDURE p1;

# 1.1.1.1
CREATE USER test_user1 IDENTIFIED BY 'azundris1';
GRANT ALL on *.* TO test_user1;

# 1.1.1.2
CREATE USER test_user2 IDENTIFIED BY 'azundris2';

# 1.1.1.3
CHANGE REPLICATION SOURCE TO SOURCE_PASSWORD='azundris3';

# 1.1.1.4
CREATE USER 'test_user4'@'localhost';
SET PASSWORD FOR 'test_user4'@'localhost' = 'azundris4';

--let $mask_user_password_events=1
--let $mask_grant_as_events=1
--source include/show_binlog_events.inc
--let $mask_user_password_events=0

DROP USER 'test_user4'@'localhost';
DROP USER test_user2;
DROP USER test_user1;

RESET MASTER;
RESET SLAVE;
--echo End of 5.6 tests!