~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/binlog/t/binlog_grant.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test grants for various objects (especially variables) related to
 
2
# the binary log
 
3
 
 
4
source include/have_log_bin.inc;
 
5
 
 
6
connection default;
 
7
--disable_warnings
 
8
reset master;
 
9
--enable_warnings
 
10
 
 
11
set @saved_binlog_format = @@global.binlog_format;
 
12
create user mysqltest_1@localhost;
 
13
show grants for mysqltest_1@localhost;
 
14
 
 
15
connect (plain,localhost,mysqltest_1,,test);
 
16
connect (root,localhost,root,,test);
 
17
 
 
18
# Testing setting both session and global SQL_LOG_BIN variable both as
 
19
# root and as plain user.
 
20
 
 
21
--echo **** Variable SQL_LOG_BIN ****
 
22
 
 
23
connection root;
 
24
--echo [root]
 
25
set session sql_log_bin = 1;
 
26
 
 
27
connection plain;
 
28
--echo [plain]
 
29
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
 
30
set session sql_log_bin = 1;
 
31
 
 
32
 
 
33
# Testing setting both session and global BINLOG_FORMAT variable both
 
34
# as root and as plain user.
 
35
 
 
36
--echo **** Variable BINLOG_FORMAT ****
 
37
 
 
38
connection root;
 
39
--echo [root]
 
40
set global binlog_format = row;
 
41
set session binlog_format = row;
 
42
 
 
43
connection plain;
 
44
--echo [plain]
 
45
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
 
46
set global binlog_format = row;
 
47
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
 
48
set session binlog_format = row;
 
49
 
 
50
--echo **** Clean up ****
 
51
disconnect plain;
 
52
disconnect root;
 
53
 
 
54
connection default;
 
55
set global binlog_format = @saved_binlog_format;
 
56
drop user mysqltest_1@localhost;
 
57
 
 
58
 
 
59
# Testing if REPLICATION CLIENT privilege is enough to execute
 
60
# SHOW MASTER LOGS and SHOW BINARY.
 
61
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
 
62
--connect(rpl,localhost,mysqltest_1,,)
 
63
 
 
64
--connection rpl
 
65
# We are only interested if the following commands succeed and not on
 
66
# their output.
 
67
--disable_result_log
 
68
SHOW MASTER LOGS;
 
69
SHOW BINARY LOGS;
 
70
--enable_result_log
 
71
 
 
72
# clean up
 
73
--disconnect rpl
 
74
connection default;
 
75
DROP USER 'mysqltest_1'@'localhost';