mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / binlog / t / binlog_grant.test
blobbbf57b075afd61184f5352f30cc2756aec97ec59
1 # Test grants for various objects (especially variables) related to
2 # the binary log
4 source include/have_log_bin.inc;
6 connection default;
7 --disable_warnings
8 reset master;
9 --enable_warnings
11 set @saved_binlog_format = @@global.binlog_format;
12 create user mysqltest_1@localhost;
13 show grants for mysqltest_1@localhost;
15 connect (plain,localhost,mysqltest_1,,test);
16 connect (root,localhost,root,,test);
18 # Testing setting both session and global SQL_LOG_BIN variable both as
19 # root and as plain user.
21 --echo **** Variable SQL_LOG_BIN ****
23 connection root;
24 --echo [root]
25 --error ER_LOCAL_VARIABLE
26 set global sql_log_bin = 1;
27 set session sql_log_bin = 1;
29 connection plain;
30 --echo [plain]
31 --error ER_LOCAL_VARIABLE
32 set global sql_log_bin = 1;
33 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
34 set session sql_log_bin = 1;
37 # Testing setting both session and global BINLOG_FORMAT variable both
38 # as root and as plain user.
40 --echo **** Variable BINLOG_FORMAT ****
42 connection root;
43 --echo [root]
44 set global binlog_format = row;
45 set session binlog_format = row;
47 connection plain;
48 --echo [plain]
49 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
50 set global binlog_format = row;
51 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
52 set session binlog_format = row;
54 --echo **** Clean up ****
55 disconnect plain;
56 disconnect root;
58 connection default;
59 set global binlog_format = @saved_binlog_format;
60 drop user mysqltest_1@localhost;
63 # Testing if REPLICATION CLIENT privilege is enough to execute
64 # SHOW MASTER LOGS and SHOW BINARY.
65 GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
66 --connect(rpl,localhost,mysqltest_1,,)
68 --connection rpl
69 # We are only interested if the following commands succeed and not on
70 # their output.
71 --disable_result_log
72 SHOW MASTER LOGS;
73 SHOW BINARY LOGS;
74 --enable_result_log
76 # clean up
77 --disconnect rpl
78 connection default;
79 DROP USER 'mysqltest_1'@'localhost';