1 --source include/not_embedded.inc
3 CREATE USER test1@localhost;
4 CREATE USER test2@localhost;
5 GRANT USAGE ON *.* TO test1@localhost;
6 GRANT USAGE ON *.* TO test2@localhost;
7 GRANT CREATE, DROP, INSERT, SELECT ON
test.* TO test1@localhost;
8 GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON
test.* TO test2@localhost;
10 --echo connect (test1,localhost,test1,,
test,MASTER_MYPORT,MASTER_MYSOCK);
11 connect (test1,localhost,test1,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
12 SELECT current_user();
13 SHOW GRANTS FOR CURRENT_USER;
16 --source suite/parts/inc/part_exch_tabs.inc
19 --error ER_TABLEACCESS_DENIED_ERROR
20 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
21 --echo disconnect test1;
25 --echo connect (test2,localhost,test2,,
test,MASTER_MYPORT,MASTER_MYSOCK);
26 connect (test2,localhost,test2,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
28 SELECT current_user();
29 SHOW GRANTS FOR CURRENT_USER;
31 # 9) Exchanges with different owner.
32 # Privilege for ALTER and SELECT
33 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
37 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
38 # Back to former values.
39 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
43 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
44 ALTER
TABLE tsp EXCHANGE PARTITION sp00 WITH
TABLE tsp_00;
48 SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
49 # Back to former values.
50 ALTER
TABLE tsp EXCHANGE PARTITION sp00 WITH
TABLE tsp_00;
54 SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
55 --echo disconnect test2;
58 --echo connection
default;
60 REVOKE ALTER ON
test.* FROM test2@localhost;
62 --echo connect (test2,localhost,test2,,
test,MASTER_MYPORT,MASTER_MYSOCK);
63 connect (test2,localhost,test2,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
65 SELECT current_user();
66 SHOW GRANTS FOR CURRENT_USER;
67 # Privilege for ALTER and SELECT
68 --error ER_TABLEACCESS_DENIED_ERROR
69 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
70 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
71 # Back to former values.
72 --error ER_TABLEACCESS_DENIED_ERROR
73 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
74 --error ER_TABLEACCESS_DENIED_ERROR
75 ALTER
TABLE tsp EXCHANGE PARTITION sp00 WITH
TABLE tsp_00;
76 # Back to former values.
77 --error ER_TABLEACCESS_DENIED_ERROR
78 ALTER
TABLE tsp EXCHANGE PARTITION sp00 WITH
TABLE tsp_00;
80 --echo connection
default;
82 --echo disconnect test2;
85 --source suite/parts/inc/part_exch_drop_tabs.inc
87 DROP USER test1@localhost;
88 DROP USER test2@localhost;