blob: c77075c2393565d0ec197f138d3e48ed744838ce (
plain)
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
|
--source include/have_innodb.inc
--source include/not_embedded.inc
--source include/have_metadata_lock_info.inc
--echo #
--echo # Test privileges for BACKUP STAGES
--echo #
--disable_service_connection
set sql_mode="";
GRANT RELOAD ON *.* TO user1@localhost;
GRANT CREATE, DROP ON *.* TO user2@localhost;
--connect(con1, localhost, user1)
BACKUP STAGE START;
BACKUP STAGE END;
--echo # change_user must release backup lock
BACKUP STAGE START;
BACKUP STAGE FLUSH;
SELECT lock_mode FROM information_schema.metadata_lock_info WHERE lock_type='Backup lock';
change_user user2;
SELECT lock_mode FROM information_schema.metadata_lock_info WHERE lock_type='Backup lock';
--disconnect con1
--source include/wait_until_disconnected.inc
--connection default
--echo # A very low privileged user (-> con4) cannot acquire the backup lock
--connect(con1, localhost, user2)
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP STAGE START;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP STAGE FLUSH;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP STAGE BLOCK_DDL;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP STAGE BLOCK_COMMIT;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
BACKUP STAGE END;
--disconnect con1
--source include/wait_until_disconnected.inc
--connection default
DROP USER user1@localhost, user2@localhost;
--echo #
--echo # Test using BACKUP STAGES in a SP
--echo #
--error ER_SP_BADSTATEMENT
create procedure foo42()
BACKUP STAGE START;
--enable_service_connection
|