1 # Test grants for various objects (especially variables) related to
4 source include/have_log_bin.inc;
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 ****
25 --error ER_LOCAL_VARIABLE
26 set global sql_log_bin = 1;
27 set session sql_log_bin = 1;
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 ****
44 set global binlog_format = row;
45 set session binlog_format = row;
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 ****
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,,)
69 # We are only interested if the following commands succeed and not on
79 DROP USER 'mysqltest_1'@'localhost';