summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/r/partition_exch_qa_6.result
blob: bef277f695a2556ed5c2ce421872e8b4a78b9794 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
CREATE USER test2@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
connect  test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a	b
2	Two
4	Four
6	Six
8	Eight
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a	b
1	One
3	Three
5	Five
9	Nine
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a	b
1	One
3	Three
5	Five
9	Nine
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
a	b
2	Two
4	Four
6	Six
8	Eight
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
SELECT * FROM tsp_00;
a	b
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a	b
2	Two
4	Four
5	Five
6	Six
8	Eight
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
SELECT * FROM tsp_00;
a	b
5	Five
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
a	b
2	Two
4	Four
6	Six
8	Eight
disconnect test2;
connection default;
REVOKE INSERT ON test.* FROM test2@localhost;
connect  test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
connection default;
GRANT INSERT ON test.* TO test2@localhost;
REVOKE CREATE ON test.* FROM test2@localhost;
connect  test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ERROR 42000: CREATE command denied to user 'test2'@'localhost' for table 'tsp'
disconnect test2;
connection default;
GRANT CREATE ON test.* TO test2@localhost;
REVOKE DROP ON test.* FROM test2@localhost;
connect  test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
GRANT USAGE ON *.* TO 'test2'@'localhost'
GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO 'test2'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: DROP command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
connection default;
DROP TABLE IF EXISTS t_10;
DROP TABLE IF EXISTS t_100;
DROP TABLE IF EXISTS t_1000;
DROP TABLE IF EXISTS tp;
DROP TABLE IF EXISTS tsp;
DROP TABLE IF EXISTS tsp_00;
DROP TABLE IF EXISTS tsp_01;
DROP TABLE IF EXISTS tsp_02;
DROP TABLE IF EXISTS tsp_03;
DROP TABLE IF EXISTS tsp_04;
DROP TABLE IF EXISTS t_empty;
DROP TABLE IF EXISTS t_null;
DROP USER test2@localhost;